DEV Community

JeroenTDC
JeroenTDC

Posted on

Issue: Cached version of index.html

I'm looking for a solution or insight on the following issue I have experienced. And please be kind - I'm relatively new to the React universe :)

When me or my team release updates to our website, created in React as a Single Page Application, simply refreshing a browser in an attempt to see the update, a cached older version of the website is commonly seen.

Since I have a background of being a web developer, noticing this issue, made me wonder how the caching of the index.html file is handled. I'm thinking, it's all nice and sweet that compiled JS files are hashed in order to announce new versions, but the index.html will always be called the same.

My mind is a bit boggled on what is telling the client side browser to get the updated JS files!?

Why is it hard to find SPA websites with an index.html that includes META tags regarding cache control (no-cache, expires, etc.)?

Is not caching the index file of SPA's always handled server side, which could indicate a problem with our hosting?

Looking really forward to any insights and feedback here :)

Top comments (0)