I have a website which extensively uses files which are static like Jquery library, images and some other functionality JS files.

So, I wish to set infinite expiry time for those resources so that those can be easily retrieved from users cache. This will enhance his experience and reduce the loading file

Can anyone suggest how to do the same using .htaccess or any other method.

Thanks !

有帮助吗?

解决方案

http://httpd.apache.org/docs/current/mod/mod_expires.html You might be looking for the ExpiresByType directive? I suppose, setting it to 10 years will be sufficient. However, be careful with updates to those files then.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top