Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to make browsers refresh browser cache on updated website?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-13-2014, 04:47 PM
 
zebu zebu is offline
 

eXpert
  
Join Date: Oct 2006
Posts: 310
 

Default How to make browsers refresh browser cache on updated website?

Hi All,

We just updated the skin on our website. (all new look) What we are finding is that when viewing in a web browser that has previously viewed the site recenty, - the site looks all screwed up until you do a ctrl + F5 to do a page refresh.

Obviously the browsers are looking to a local cache first. 2 days on and customers still have issues. I figured any cached files in browsers - would time out by now.

Is their a way to put some code on the page, to force the browser to bypass the local cache and get a new copy (at least just for the homepage to pull in the correct css files.???
Thanks
__________________
Version 4.7.7
Reply With Quote
  #2  
Old 03-14-2014, 04:23 AM
  Petepots's Avatar 
Petepots Petepots is offline
 

eXpert
  
Join Date: Aug 2007
Location: Surrey, UK
Posts: 275
 

Default Re: How to make browsers refresh browser cache on updated website?

Have up run cleanup.php
__________________
Version 4.7.2
Reply With Quote
  #3  
Old 03-14-2014, 09:11 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: How to make browsers refresh browser cache on updated website?

Perhaps configure a cronjob to run cleanup.php every couple of days?
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #4  
Old 03-14-2014, 10:18 AM
 
zebu zebu is offline
 

eXpert
  
Join Date: Oct 2006
Posts: 310
 

Default Re: How to make browsers refresh browser cache on updated website?

Cleanup.php doesnt seem to resolve - because that cleans the cache up on the server - but not the cache on a local pc. The dispaly issue is because the local browser must have kept some sort of cache of local files from the last visit, which still obviously has some local cached components of the 'old' site.
__________________
Version 4.7.7
Reply With Quote
  #5  
Old 03-14-2014, 12:09 PM
 
Thomasb134 Thomasb134 is offline
 

X-Adept
  
Join Date: Apr 2007
Location: USA
Posts: 789
 

Default Re: How to make browsers refresh browser cache on updated website?

Some chatter about it here:
http://stackoverflow.com/questions/1922910/force-browser-to-clear-cache

and here:
http://fatherofcents.com/clear-browser-cache-using-html-or-php/
__________________
Thomas / USA
XCart V4.4.5 Gold
XCart Mobile V1.4.12
XCart X-PDF
XCart X-HotProducts
AlteredCart Checkout One (One Page Checkout)
BCSE Back In Stock
CFL Holiday Message
CFL System Message
Smack Digital (WebsiteCM) Remember Anon Carts
xcartmods Testimonials
xcartmods reCAPTCHA for X-Cart Classic
Unix, PHP 7.0 (patched 5.4).
MySQL 5.6
Reply With Quote
  #6  
Old 03-14-2014, 09:41 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,195
 

Default Re: How to make browsers refresh browser cache on updated website?

Use htaccess and Expires header. YOu can set which file types expire when - this tells the browser if they need to download fresh from the server or use the local cache
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 03-21-2014, 01:58 PM
 
zebu zebu is offline
 

eXpert
  
Join Date: Oct 2006
Posts: 310
 

Default Re: How to make browsers refresh browser cache on updated website?

Steve:

Htacces with expires header - would that be this code:

ExpiresActive On Expires
Default A1
Header append Cache-Control must-revalidate

And which .htaccess file would that go in - the one in the root of the /skin folder?

Thanks in advance
__________________
Version 4.7.7
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:32 AM.

   

 
X-Cart forums © 2001-2020