ron13315
Member
- Joined
- Jul 23, 2014
- Messages
- 283
- Points
- 18
Hi, im thinking a way to make the site with a lot of images to load faster.
i want all the images to be cached if loaded once in a browser so the next visit the site will load fast.
I tried to insert this following code in my .htacess but no seem to work.
i want all the images to be cached if loaded once in a browser so the next visit the site will load fast.
I tried to insert this following code in my .htacess but no seem to work.
Code:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
Code:
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>