| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Caching Trustlogo and other third-party js files | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Caching Trustlogo and other third-party js files
A couple of days ago my site wasn't loading due to the Addthis server not responding when my pages were trying to load the Addthis javascript file. This has also happened in the past with the Comodo trustlogo. It really sucks when this happens as you have no control over the other server and you need to hack your site real quick to get the references off your site to get it up and running - once you notice it.
Well, the solution is really pretty simple. Copy the javascript files to your server and load them from there. Doh! Why didn't I do this years ago? But you want to be sure you load the latest version of the javascript file. So setup a cron job to recopy the files every night. Simple and effective. To do this first add a directory called "cache" in your xcart directory where you will store copies of the js files on your server. For a Comodo trustlogo you will have something like this in one of your templates: Code:
Before you change this go to your web hosting control panel and setup a cron job to copy the trustlogo.js file to your cache folder once a day using this command: Code:
Now go ahead and change the <script> tag in your template to: Code:
No more hangs if the Comodo server isn't responding. I did the same thing for my Hackerproof logo javascript and my Addthis javascript. Now no more scrambling to figure out why my site's not loading and scrambling to rip out a logo or Addthis.
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
|
#2
|
|||||||||
|
|||||||||
Re: Caching Trustlogo and other third-party js files
Always a great idea. Lots of third party companies don't minimize or compress their js either, so you could do that to make your site load even faster. Additionally, the js could be loaded from a CDN.
|
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Caching Trustlogo and other third-party js files
That's great Ralph. Wish we had this before all the problems with Comodo last year
Any idea if this works (or variations) for GoDaddy's Site Seal and McAfee's Site Seals?
__________________
Conor Treacy - Big Red SEO - @bigredseo Search Engine Optimization & Internet Marketing - We Bring Your Website Out Of Hiding! If you can't be found on Google, Bing or Yahoo, you pretty much don't exist on the Internet. Omaha SEO Office with National & Local SEO Services Hourly Consulting - great for SEO Disaster Recovery, Audits and DIY Guidance |
|||||||||
#4
|
|||||||
|
|||||||
Re: Caching Trustlogo and other third-party js files
Yeah, it seems to be an annual thing with Comodo and usually when I'm too busy to do anything but rip the seal off the site. Wish I'd thought of it sooner.
I'm not real familiar with the other seals but I don't see any reason it wouldn't work wherever they load a js file.
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Caching Trustlogo and other third-party js files
Anybody get this to work with the Comodo corner of trust.
If you try this with McAfee Secure you get a blank image for the get. Darn it!
__________________
Dedicated Server provided by EWD Hosting X-Cart version 4.1.12 PHP 5.3.2 MySQL server 5.0.87-community Operation system Linux Perl 5.008008 dogbytecomputer.com |
|||||||||
|
|||
X-Cart forums © 2001-2020
|