Results 1 to 8 of 8

Thread: Server Caching Style Sheets

  1. #1
    Join Date
    Jun 2005
    Location
    Tunbridge Wells, Kent
    Posts
    203
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Server Caching Style Sheets

    Where would you hunt down the annoying switch which allows a windows server to cache style sheets?!!

    Everytime we reset the server, the style sheet refreshes... it can become cached for along time...

  2. #2
    Join Date
    Feb 2004
    Posts
    4,877
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Static files like that are sent with headers that tell the browser to cache the file locally for x days.

    To trick it, simply have your website reference the stylesheets like so:

    http://www.domain.com/style.css?random=454534

    ...then just change the numbers whenever you want to force all browsers that have cached style.css to redownload the latest version.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Oct 2005
    Location
    Scotland
    Posts
    229
    Thanks
    7
    Thanked 12 Times in 8 Posts

    Default

    Ctrl + F5 usually does the business for me.

  4. #4
    Join Date
    Feb 2007
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Interesting topic - I'm seeing a similar effect on javascript files at present.

    We are using the workaround at present of adding a version number to the URL and it works OK but it does require some manual maintenance (and the alternative of using a random number causes some unnecessary cache delays)

    I was wondering if there is any way of changing the "Cache-Control: max-age=864000" HTTP Header using HELM?

    I guess not - but there's no harm in asking...

    Cheers

    H

  5. #5
    Join Date
    Feb 2004
    Posts
    4,877
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Currently no, that is the server wide setting we are currently using for local caching of static files.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  6. #6
    Join Date
    Jun 2005
    Posts
    1,080
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    I believe the Developer Toolbars available for Mozilla and IE allow you to disable caching whilst viewing a site. Of course, this means that if you update a live site customers will see cached versions until theirs expires.

  7. #7
    Join Date
    Feb 2007
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks

    I think we might try to get around this by changing the affected files to ASP and then using

    <% @Language="VBScript" %>
    <% Response.CacheControl = "max-age=3600" %>

    or similar.

    Of course we'll also have to set Response.ContentType too...

  8. #8
    Join Date
    Feb 2004
    Posts
    4,877
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    That's one way...
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 24th April 2007, 02:49 PM
  2. Caching
    By spire128 in forum ASP.NET
    Replies: 3
    Last Post: 5th February 2007, 10:48 AM
  3. Battle of Trafalgar - 2006 style
    By nick in forum Jokes and Stories
    Replies: 1
    Last Post: 23rd October 2006, 12:40 PM
  4. www.celtic-style.com, feedback please
    By davidbending in forum For Sale, Sites and Services
    Replies: 2
    Last Post: 23rd September 2006, 12:17 PM
  5. HOWTO: Handle Website Caching
    By Warren Ashcroft in forum Technical Support
    Replies: 0
    Last Post: 22nd December 2005, 12:51 PM

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
  •