|||

What Statamic’s SAVE_CACHED_IMAGES really does

I think I got SAVE_CACHED_IMAGES in Statamic wrong the whole time. I thought it’s about whether Glide-generated images are kept when clearing caches. Assuming I got it right, this is what it really does:

When set to true:

  • All image presets defined in assets.php will be generated on upload.
  • All Glide image variants referenced on a page will be generated on initial page load.
  • All Glide variants required anywhere will be generated when warming the static cache.
  • Image variants are stored in /uploads/img/containers/.

When set to false:

  • All image presets defined in assets.php will still be generated on upload.
  • Only the images requested by the browser will be generated and cached.
  • Image variants are stored in /storage/statamic/glide/containers.

Generated Glide variants are never wiped by clearing the application cache, no matter how SAVE_CACHED_IMAGES is set.

Consequences

Setting SAVE_CACHED_IMAGES to false:

  • Will make initial loading times for pages with new images faster, because only the image in the format and resolution as requested by the browser will be generated (and cached for subsequent requests), not all sizes and formats referenced in markup.
  • Uploading new images in the panel will be faster because asset presets won’t be generated.
  • Less storage will be needed because when set to true lots of images are generated and potentially never used.
Up next Setting Up Job Scheduling in Statamic If a Job implements ShouldQueue the Job will be automatically added to the queue (as do both Shopify Statamic and Statamic Peak|Peak Social Image Pont de l’Abîme
Latest posts Pros and Cons of Reflect Notes App A Love Letter to Sublime Internet Lazy.so is an amazing tool. Here's why I don't keep it Look Around You Don’t ask what the world needs Carl Sagan has shown the absurdity of not acting against climate change back in 1990 On the plus sides of being a web designer Friday Deployment A success message that communicates the opposite of success Do not demand to be appreciated Craft Docs vs Bear Notes Figma AI Rant Epomaker TH80 Pro Polyamor, aber mit PKM apps 🫣 Ironie, die Fabi Rommel Helft der Natur Stimmen im Kopf - Flohmarkt croox website online Tiny Garden Paradise Oktober in Europa Figma Rant: forever assembling iCloud Drive Rant Schwiegerfuchs Same Vibe Tailwind and Web Craftsmanship Buttons with CSS Expand Basic Markdown Formatting in Apple Notes Cannot Divide by Zero in Peak Picture Partial Applying a Growth Mindset (Doodle) When Gmail Messages deleted in Apple Mail keep coming back