SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    East Midlands, United Kingdom
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile No Cache on webpages

    Dear Sitepoint community,

    I have a number of numbers that I've updated, the problem is that by updating the website I have a problem, with returning users seeing a dreadful looking website, due to the cache on the web browsers not being cleared.

    Is there some Javascript code or anyother code that will clear the web user previous visit to a new uploaded website?

    The website needs to be refreshed when the web page is loading.

    Many thanks

  2. #2
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not quite sure what you're asking. Are you wanting to know if you can clear a user's cache? The answer is no (that would be bad). You can tell the browser that you don't want a certain page cached and it might listen to you. Another thing you can do is change the filenames so it has to refresh (a good example of this would be including a version number in your css file name like: main.v1.0.css or using a timestamp or something).

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by overthemike View Post
    Not quite sure what you're asking. Are you wanting to know if you can clear a user's cache? The answer is no (that would be bad). You can tell the browser that you don't want a certain page cached and it might listen to you. Another thing you can do is change the filenames so it has to refresh (a good example of this would be including a version number in your css file name like: main.v1.0.css or using a timestamp or something).
    Using the querystring for the version number or timestamp is typically the more accepted solution these days.

    e.g., main.css?1.0
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •