0

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
1
  • Plz elaborate the problem Commented Nov 4, 2019 at 5:08

1 Answer 1

1

Yeah, 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.