.htaccess - htaccess leverage browser caching for images -
.htaccess - htaccess leverage browser caching for images -
i have code on .htaccess file
## expires caching ## <ifmodule mod_expires.c> expiresactive on # media expiresbytype image/jpg "access plus 1 year" expiresbytype image/jpeg "access plus 1 year" expiresbytype image/gif "access plus 1 year" expiresbytype image/png "access plus 1 year" expiresbytype image/x-icon "access plus 1 year" expiresbytype application/x-shockwave-flash "access plus 1 year" # codes expiresbytype text/css "access plus 1 month" expiresbytype text/x-javascript "access plus 1 month" expiresbytype application/javascript "access plus 1 year" # webfonts expiresbytype application/x-font-ttf "access plus 1 year" expiresbytype font/opentype "access plus 1 year" expiresbytype application/x-font-woff "access plus 1 year" expiresbytype image/svg+xml "access plus 1 year" expiresbytype application/vnd.ms-fontobject "access plus 1 year" expiresdefault "access plus 2 days" </ifmodule> ## expires caching ## but still having error of "leverage browser caching" when trying test website speed!
when tried view error details:-
before using code above, had lot of links! have png,jpg,js files.
hope can help me.
you need enable mod_expires. apache :
a2enmod expires service apache2 restart .htaccess caching browser-cache
Comments
Post a Comment