Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts

    Question "No-Cache" only works for HTML code??

    Hello, everyone.

    I've got the following meta tag in the document head:
    Code:
    <meta http-equiv="Cache-Control" content="No-Cache" />
    Yet in FF17, the browser has been caching CSS and JavaScript files. I've been trying to troubleshoot a JS issue, and changes that I made were not being applied. Even though I've set FF cache to 0.

    Is the meta tag only for HTML (still caching JS/CSS)? Or only IE?

    Thank you,
    Last edited by WolfShade; 04-18-2013 at 04:17 PM.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,374
    Thanks
    11
    Thanked 592 Times in 572 Posts
    im not even sure it still works on the html page that it was supposed to work on.
    http-equiv directives should be the same as setting a header on the html url, that's it.
    Last edited by rnd me; 04-18-2013 at 03:42 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Is there anything, programmatically, that will prevent caching?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,374
    Thanks
    11
    Thanked 592 Times in 572 Posts
    Quote Originally Posted by WolfShade View Post
    Is there anything, programmatically, that will prevent caching?
    yes, appending a random number or the date to the requersted url.


    ex:

    /styles/main.css becomes /styles/main.css?243453465
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #5
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Oh, my. Alright.. I'll give that a shot. Thanks!

    UPDATE: Yup.. did the trick, alright. Generating a random number in ColdFusion and tacking that on to all .js and .css files, and even having JS generate a random number and use that for scripts that are loaded via JavaScript. Every page refresh is indicating that every file is being requested for data, none cached.
    Last edited by WolfShade; 04-18-2013 at 04:17 PM.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,374
    Thanks
    11
    Thanked 592 Times in 572 Posts
    Quote Originally Posted by WolfShade View Post
    Oh, my. Alright.. I'll give that a shot. Thanks!

    UPDATE: Yup.. did the trick, alright. Generating a random number in ColdFusion and tacking that on to all .js and .css files, and even having JS generate a random number and use that for scripts that are loaded via JavaScript. Every page refresh is indicating that every file is being requested for data, none cached.
    well, if you have cold fushion, the better way to do it would be to emit cache header(s) on the css and js files. Expires, set to a date in the past should do the trick. for bonus points.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I assume you are only doing this during development for easy debugging purposes and not in production site.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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