69
le-velo
8y

There's not much worse than trying to fix your CSS for half an hour, only to realise that it's a cache issue...

Comments
  • 4
    This is how I handle this:
    Append a version get parameter on every linked file.
    /css/main.css becomes /css/main.css?v=1.0
    On each release the number gets incremented. The handling server should ignore unknown GET parameters, but the browser will handle it as a different file, hence force loading it. I automated it using some variables in VS but I don't know how exactly how I did it right now.
    While debugging I use v1.0d1 or similar.
    Works well and no more caching issues, especially when you deliver files with long cache times to reduce loading times.
  • 0
    @Kimmax That sounds handy. Cheers
  • 1
    Most browsers have an option where you can disable the cache when the developer tools are open. I find that very useful.
  • 1
    Been there done that I HATE IT -_-
  • 0
    Keep the developer tool open fuck other browsers.
  • 0
    Yup! Or if you're using symphony and forgot to dump your assets. OR if you're accidentally reloading the live page instead of your dev environment. #frontendproblems
  • 1
    😁😁😁
  • 1
    @ymas @error503 ohh right. Using this you don't have to update the versions while developing. But don't forget to do it when you push the changes and have high cache times. Users will see a broken layout while you think everything is fine
  • 1
    @modeissey welcome to devRant.
Add Comment