I am absolutely comfortable utilizing HTACCESS but I am working on speed load. I have a minified JS file. How would I go about adding this into my HTACCESS?
Below I was going to add this line to htaccess to leverage browser cache for minified JS file.
ExpiresByType application/js.min A31536000
I am absolutely comfortable utilizing HTACCESS but I am working on speed load. I have a minified JS file. How would I go about adding this into my HTACCESS?
Below I was going to add this line to htaccess to leverage browser cache for minified JS file.
ExpiresByType application/js.min A31536000
Share
Improve this question
asked Feb 5, 2017 at 21:29
RobRob
446 bronze badges
1
- Plz elaborate the problem – meDeepakJain Commented Nov 4, 2019 at 5:08
1 Answer
Reset to default 1Yeah, you can do leverage browser caching for minified js & css files same as we do for other files.
<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 application/javascript "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
You are talking about speed, for that you can add gzip or deflate in htaccess.