corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Caching JavaScript content from other websites


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Caching JavaScript content from other websites
Sam
Moderator
Premium Member


Registered: 24th Dec 99
Location: West Midlands
User status: Offline
13th Jan 13 at 21:11   View User's Profile U2U Member Reply With Quote

One website I manage has to load some payment processor icons/information via a JavaScript file on the third party server.

The problem is, sometimes their stuff takes ages to load on the page or times out, resulting in the page not loading properly.

Is there a way of caching this script or the output it generates maybe?
ed
Member

Registered: 10th Sep 03
User status: Offline
13th Jan 13 at 22:02   View User's Profile U2U Member Reply With Quote

I do this on a few sites using a bit of PHP - I check the age of a local copy of the script and if it's x seconds old I load a fresh version and save it, otherwise I load the local copy.

This is useful when you're loading a JSON Twitter feed because their site is bloody slow.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Who Is Interested in Re-Designing A Web Site For Me :-) Bart General Chat 15 487
23rd Sep 04 at 09:47
by broster
 
Help needed from computer people (Javascript?!) mwg General Chat 12 979
15th Dec 04 at 22:04
by Drew
 
PHP Popup Window liamC Geek Day 3 1295
1st Apr 07 at 23:07
by Steve
 
Domain names / hostings koolkorsa Geek Day 11 1037
24th Feb 09 at 16:58
by xa0s
 
My website - testing please [UPDATE NO.2] AndyKent Geek Day 44 741
29th Jul 10 at 15:34
by AndyKent
 

Corsa Sport » Message Board » Off Day » Geek Day » Caching JavaScript content from other websites 28 database queries in 0.0127699 seconds