Jump to content

Caching external javascript


Drongo_III

Recommended Posts

Hi Guys

 

I'm not entirely sure this is the right section but I need a little advice.

 

Three quick questions:

 

1) Can you force caching on a script (js) that's loaded from an external source over which you have no direct control. So lets say you have a script being loaded on a page async. - i.e. via createNewElement...  Can you force that script to cache?

 

2) This may actually answer question one -  is an external script served under the headers of the source server?  So if that server had caching set on all script files and I incorporated a script from that server into a page on my server would that file be subject to the source servers caching?

 

3) If point two is the case - then does that count for all files incorporated from an external source?

 

Thanks,

 

Drongo

Link to comment
https://forums.phpfreaks.com/topic/295345-caching-external-javascript/
Share on other sites

1) Can you force caching on a script (js) that's loaded from an external source over which you have no direct control. So lets say you have a script being loaded on a page async. - i.e. via createNewElement...  Can you force that script to cache?

No. Once you provide the URL you stop being involved.

 

2) This may actually answer question one -  is an external script served under the headers of the source server?  So if that server had caching set on all script files and I incorporated a script from that server into a page on my server would that file be subject to the source servers caching?

Right.

 

3) If point two is the case - then does that count for all files incorporated from an external source?

Yes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.