Search code examples
google-chrome-devtoolscreate-react-appbrowser-cachecache-control

How do I know if my index.html is being cached in my CRA app? And why is it not present in network tab?


I want to set Cache-Control: no-cache for my index.html, as recommended in docs.

For my js chunks, I can locate them in my dev tools' network tab and see the headers there:
cache-control header visible in network tab

But my index.html is not present in the network tab:
no results given for "index" search in network tab

Why is that? And how can I make sure it has the Cache-Control: no-cache header on it?

I can see index in sources tab
enter image description here

The app is served by production server (not by CRA dev server), and CRA service worker is disabled.


Solution

  • The reason I don't see a request labeled "index" in the network tab is because I am not requesting index.html directly, I get it as a response when requesting a specific in-app url. I can find the respective request in devtools network tab under current URL, and it has text/html in the type column.