• Is there any way to prevent images from being purged from the cache when the cache is purged (eith a limited purge or a purge everything)?

    I have a site that has a lot of images for products. These don’t change. It would be much more efficient if these stayed cached and were not purged when pages/post etc on the site were update (which currently results in a wider or complete purge of the site cache).

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Enable the “Purge HTML pages only” option: https://i.imgur.com/0sXRDrV.png

    Thread Starter thomastolkien

    (@thomastolkien)

    Thanks.

    If I enable that, then CSS and JS files will not be purged? Is that correct?

    Is there any way to ensure just images are not purged? Maybe a custom function, or a php snippet?

    Thanks for your help.

    Plugin Contributor iSaumya

    (@isaumya)

    If I enable that, then CSS and JS files will not be purged? Is that correct?

    – No they won’t. To purge then you need to use the option Force Purge Everything under the purge cache option.

    Is there any way to ensure just images are not purged? Maybe a custom function, or a php snippet?

    – There is not as images fall under static files just like any other static files. You don’t need to change your css/js files often so they can be cached for a long duration like images. But the choice is up to you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent images from being purged from the cache’ is closed to new replies.