DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: I rebuilt my portfolio🌻 Now it loads in 1.6s πŸŽ‰ Here's how I did

Collapse
 
justhere profile image
yas

If you make changes to your css, since everything is cached in browser, it wont fetch latest css, unless a hard reload is done manually. am i right?

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻 Author • Edited on

I'm not really caching it but yes that is how it works when you use service worker and cache css. However there are some tricks to handle it like you can manually show in Ui when new css is ready and ask user to update and onclick of the update the new css can be loaded dynamically. Also, even without a hard reload they eventually get cached replacing the old ones.

Edit: If you're talking about the browser's cache without service worker, I am not very sure about this but I've seen sites eventually adapt to new css without hard reloads. I looked around and apprenntly it also depends on your server configurations.