DEV Community

Flask, CSS and Cache walked into a bar...

Sushant Kumar Das on January 24, 2021

Hello reader :) I would finish this joke but it's meaningless without context. Hence bear with me till the end, to experience the best joke ever. ...
Collapse
 
nigelmrodgers profile image
Nigel M Rodgers

You can add a query string that changes on every page load like

example.com/style.css/?ver=12345678

I use the time function. DON'T FORGET to remove the query string when going live. There is probably an automated way to do this.

Collapse
 
sush_kd profile image
Sushant Kumar Das

Thanks for the suggestion. I will try it. : )

Collapse
 
brandonwallace profile image
brandon_wallace

Another thing you do is in the developer tools you can go to the "Network" tab and check off "Disable cache". Sometimes you will have to uncheck it, refresh browser page, then put the check mark back and refresh the page again. I have done that in Chrome and Firefox.

Collapse
 
sush_kd profile image
Sushant Kumar Das

Good idea. I will try it. :)

Collapse
 
arberbr profile image
Arber Braja

Easily fixable issue though if you always hard reload while developing. Browsers do marvelous things on their own, things which help us have faster load times and better experience but they are not always smart.

So always do hard reload of a page while developing and you should not see problems like this at all.

Collapse
 
sush_kd profile image
Sushant Kumar Das

Yes, you're right. I understood that with experience. Thanks :)

Collapse
 
rachitprojects profile image
rachitprojects

Dude I thought you'd leave the puns in 2020. 🀣🀣🀣 Must say this post is my guilty pleasure

Collapse
 
sush_kd profile image
Sushant Kumar Das

My puns are a part of me XD. Thanks though. :)

Collapse
 
swani_didde_63ceba69d5108 profile image
Swani Didde

That was one hella roller coaster . πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚

Collapse
 
sush_kd profile image
Sushant Kumar Das

XDXD Thanks. That was the intention. :)

Collapse
 
prasanna28devadiga profile image
Prasanna28Devadiga

was hooked till the very ending

Collapse
 
sush_kd profile image
Sushant Kumar Das

Thanks :)

Collapse
 
debashishere profile image
DEBASHIS ROY

test