Jump to content

Caching external javascript


Drongo_III
 Share

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
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.
Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

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