Jump to content

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.