Mobile app version of vmapp.org
Login or Join
Phylliss660

: 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>

@Phylliss660

Posted in: #Apache #Cache

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

2 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

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.

10% popularity Vote Up Vote Down


 

@Pope3001725

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme