SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cache prob with .js files

    Hi,
    I use .js files for scripts.
    but when i make changes to this .js file and upload the file to server.
    the end users couldnot see the changes as they get the old .js file which is in cache.
    they have to clear the cache to c the changes.
    but it should not be that way i guess.
    Is there any way that i can make the users to get the files from
    servers instead from cache?

    early reply appreciated.
    Happy Coding!!!
    Bruce Lee.

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try putting this in the <head> of your page:

    <meta http-equiv="cache-control" content="no-cache">

    I don't know much about html meta tags, but that is supposed to inform the browser not to use the cache and send the request to the server, where your fresh page is await'n.

    I read an article, it might be old though, that says there are bugs with how browsers treat meta tags due to buffering of the page, so maybe someone with some expertise will chime in. In the meantime, you might want to go ask on the html forum.
    Last edited by 7stud; Feb 4, 2005 at 00:00.

  3. #3
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when we call for the fresh page from server does it mean we even call
    all the images and rest of the files used in the file to download fresh?
    Happy Coding!!!
    Bruce Lee.

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep


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
  •