Barry Fruitman
Barry Fruitman

Reputation: 12656

How do I get Chrome to cache my HTML/CSS changes?

My web application makes changes to the CSS dynamically with Javascript, in response to user input. When the user navigates away from the updated page, then hits BACK, it reloads the page from the disk cache but the CSS changes are gone. So the page looks like it did before the user input.

Is this normal? Is there a way to get Chrome to cache the updated HTML that includes my CSS changes?

Upvotes: 0

Views: 97

Answers (1)

shaochuancs
shaochuancs

Reputation: 16226

This is not related with Chrome. If CSS rule is changed by end user input (with JavaScript CSS operation) and nothing else is done, these CSS rule update (the latest CSS rules) is stored in browser memory, which is cleaned when page refreshes.

To make these updated-CSS "cached", you need to make it persistent by store it in LocalStorage (browser side) or Database in server.

Upvotes: 1

Related Questions