Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Page.media.images requires clearing cache?

Started by Muut Archive 9 years ago · 1 replies · 368 views
9 years ago

I added this code to one of my templates.
<div>
{% for image in page.media.images %}
{{ image.cropResize(300,200).html }}
{% endfor %}
</div>

I had one jpg file in the page's folder. When I viewed the page in a browser, I didn't see the image. After I cleared the cache via the Admin Panel Dashboard, I then saw the image in the browser. If I add additional images, I have to clear the cache again to see the added images. Is this how Grav should work?

9 years ago

Grav really relies on the filesystem modification timestamps to determine if the cache should be cleared. On some systems, some file actions (such as deleting, renaming, or even dragging in older images than the .md file), aren't enough to trigger the re-caching.

On my Mac, most every function is enough (except deleting a file). However, for development it's best to just turn caching off.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1349 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2946 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago