: How to add a remote file to .htaccess file for webcaching? I have the following code in my .htaccess file that caches several file extension types: ## EXPIRES CACHING ## <IfModule mod_expires.c>
I have the following code in my .htaccess file that caches several file extension types:
## EXPIRES CACHING ##
<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 image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
I would like to add a remote file to the list example.com/js/jqueryvalid.js... Is this possible?
More posts by @Phylliss660
2 Comments
Sorted by latest first Latest Oldest Best
Add a local js file which loads the remote js file script.
$.getScript("url")
Now add this local file to .htacces and set expiry.
Not sure if it works. Check.
You can't control files on another domain with .htaccess or any other means without making changes on the other server. So, no, this is not possible.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.