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.
So yesterday night, I was learning flask from a freecodecamp video, and it was pretty decent. The video begins with some boilerplate, followed by the concept of templates and their inheritance. Now I faced an error, and I assume some of you guys might have faced this in the beginning too.
The CSS stylesheet that I linked in the 'base.html' file, didn't seem to work.
I tried everything, and all my code seemed to be fine as I referred to multiple sites. I rewrote the code, just to make sure I didn't commit some stupid mistake (btw my code worked in the first go with no errors except for the damn CSS.). Eventually, I was frustrated and left it.
But as fate would have it, I searched for 'CSS with flask error' on google today, just to see if other people might have faced it (In retrospect, should have done this yesterday.). And the god of programming, Stack Overflow, came to my rescue.
It had the exact same problem as mine, with 11 answers. Since the first and the most upvoted answer is usually the right one, I read it and found that I had already tried it all (The damn answer was long).
And right when I had almost lost hope, when future seemed bleak and life felt meaningless, I saw the next answer... it changed my life. I am a better person because of it. I got out of my depression and set up a billion-dollar company (all this happened a few minutes ago.)
The answer was written by Tanishka Gupta, and I quote:
try reloading the chrome using
ctrl + shift + R
And if you think this is funny, what do you think about the fact that it actually worked?
So finally, when my laughter stopped, I read a comment on this answer by VocoJax and I quote:
WHAT KIND OF MAGIC IS THIS??
(The capitalization is not my addition. It was commented this way.)
The comment described both my emotions, and the next fit of laughter I couldn't explain to my co-residents, pretty well.
So after some research, I understood that chrome saves a copy of CSS file in its cache on the first load, and uses it for that session. Simple reloads do not reset the browser cache, hence any of my changes in the CSS file weren't reflecting in the browser window. ctrl + shift + R does a complete reset of the window thus clearing the cache and using the source CSS file. Which in turn reflects the changes you do in your CSS file. Simple enough?
And hence to end this article and to finish my stupid joke,
Flask said "You still haven't changed CSS.", to which CSS said, "Hold my cashe!".
I know the joke wasn't good. Thanks for sticking around though.
Au revoir. :)
(I don't really know French.)