N
N
newbie32016-07-30 23:23:33
PHP
newbie3, 2016-07-30 23:23:33

How to cache images, javascript and css?

added to .htaccess file, these lines

<IfModule mod_expires.c>
Header append Cache-Control "public"
FileETag MTime Size
ExpiresActive On
ExpiresDefault "access plus 0 minutes"
ExpiresByType image/ico "access plus 1 years"
ExpiresByType text/css "access plus 1 years"
ExpiresByType text/javascript "access plus 1 years"
ExpiresByType image/gif "access plus 1 years"
ExpiresByType image/jpg "access plus 1 years"
ExpiresByType image/jpeg "access plus 1 years"
ExpiresByType image/bmp "access plus 1 years"
ExpiresByType image/png "access plus 1 years"
</IfModule>

but caching is not enabled on localhost

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newbie3, 2016-08-01
@newbie3

Setting up caching in Apache? helped me here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question