S
S
Sergey Erin2019-12-04 11:40:18
htaccess
Sergey Erin, 2019-12-04 11:40:18

How to set up image caching?

I have image caching configured in .htaccess, but I see that many images like .png?ver=1 or .jpg?ver=1 are not cached. How to set it up correctly? here is how it is implemented in .htaccess. Site on opencart

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/css "access plus 1 month"
# Javascript
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"

<IfModule mod_headers.c>
    Header append Cache-Control "public, no-transform"
</IfModule>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question