Reputation: 24781
To grant that single-page application (SPA) hosted on web-server won't be cached after publishing new version of that appication one should carefully check how entities requested by this application a actually fetched.
But the thing is that SPA includes html as well, and though nowadays you can see static pages as short as just html with body and two links - one for css and one for javascript, we still need to invalidate cache for this page as well.
The simplest approach is to just add relevant http headers via meta tag (like Pragma: no-cache, Pragma: no-store and so on). As mentioned in one of the answers in the link provided above, this approach work, though it's not ideal.
The thing I'm worried about is - Are we guaranteed in all browsers that we can fetch cached resources on a non-cached page? In other words, if my html page is not cached, can this affect on how script and links included are actually cached?
Upvotes: 2
Views: 605
Reputation: 3363
To answer the question "Will resources requested from a non-cached page still be able to come from cache?", your HTML pages cache setting (whether done through server headings, meta tags, or IIS/htaccess) has ABSOLUTELY no bearing on how linked resources are requested/served. If you set Javascript, CSS, and images to be retrieved from the cache, the browser is going to look at them individually, not apply the page's cache-control to them. There may be obscure one-off browsers that screw this up, but generally not the case on major ones
Upvotes: 2