Cache image thumbnails generated in Controller (not in template)

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe 4.x

When I resize images via a page controller, the thumbnails only seem to be cached for a small amount of time. Is there a way to properly cache these?


I don’t think the resampled image file is generated until you call e.g. $image-> ScaleMaxHeight(1080)->Link(). In my experience, once generated they persist indefinitely.