Fuck browser caching

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 2MuchMark
    Mark of 2Much.net
    • Aug 2004
    • 50966

    #1

    Fuck browser caching

    I despise browser caching. Trying to debug a program but stupid browser and or stupid server is still throwing errors because the js file its using is an old, cached one.
  • Major (Tom)
    So Fucking Banned
    • Nov 2003
    • 32492

    #2
    Originally posted by 2MuchMark
    I despise browser caching. Trying to debug a program but stupid browser and or stupid server is still throwing errors because the js file its using is an old, cached one.
    I feel your pain

    Comment

    • SBJ
      So Fucking Fabulous
      • Apr 2003
      • 11387

      #3
      can't you just clear your cache or am I missing something?

      Comment

      • faperoni
        Confirmed User
        • Feb 2015
        • 220

        #4
        Or add something like file.js?version=2 this way you can be 100% sure you and your users grab a fresh copy.

        Comment

        • awxm
          Confirmed User
          • Aug 2009
          • 819

          #5
          In Chrome, open developer tools, go to Network tab, check 'disable cache', refresh page.
          .

          Comment

          • just a punk
            So fuckin' bored
            • Jun 2003
            • 32393

            #6
            Shift+F5
            Obey the Cowgod

            Comment

            • Klen
              • Aug 2006
              • 32235

              #7
              Originally posted by CyberSEO
              Shift+F5
              Yep works every time

              Comment

              • 2MuchMark
                Mark of 2Much.net
                • Aug 2004
                • 50966

                #8
                No this time its different. This is the clients server that is caching, and the file its caching is a .js file. What's extra frustrating about this is that it took forever to realize it.

                Comment

                • Klen
                  • Aug 2006
                  • 32235

                  #9
                  Originally posted by 2MuchMark
                  No this time its different. This is the clients server that is caching, and the file its caching is a .js file. What's extra frustrating about this is that it took forever to realize it.
                  Well in that case, you are screwed Actually, you need to identify what method they use to store you as unique user and then change required part. For example, they could store based on your ip, or your user agent of browser.

                  Comment

                  • wankawonk
                    Confirmed User
                    • Aug 2015
                    • 1018

                    #10
                    do you have access to the server? I would just add a version number to the filename. Hopefully they coded their site so that the filename doesn't have to be changed in every single template

                    but who the fuck is caching javascript server-side? I struggle to imagine a situation where that would ever make sense

                    Comment

                    • Miguel T
                      ♦ Web Developer ♦
                      • May 2005
                      • 12473

                      #11
                      Most likely it's a load-balanced server, try getting the direct IP into your hosts file to debug quicker

                      Full Stack Webdeveloper: HTML5/CSS3, jQuery, AJAX, ElevatedX, NATS, MechBunny, Wordpress

                      Comment

                      • wankawonk
                        Confirmed User
                        • Aug 2015
                        • 1018

                        #12
                        Originally posted by Miguel T
                        Most likely it's a load-balanced server, try getting the direct IP into your hosts file to debug quicker
                        you're right, if the JS file is behind a load balancer or CDN it might be getting cached server-side (it's not a browser-caching issue, OP)

                        it's part of why I'm in the habit of bumping the filename every time I update static resources, I just code my sites so there's only one file that references the actual resource URL and every other template includes the "common includes" template or whatever

                        there's a saying that there's only 2 hard problems in computer science: naming and cache invalidation. I mostly name my variables things like "fuck_you" and "your_mom_is_a_whore" so I'm not particularly opinionated as to the difficulty of naming things but when it comes to cache invalidation god DAMN I run into some tough issues

                        Comment

                        Working...