I was using the HTML meta
tags to disable cache until I learned that this only works if the file is served locally, so I disabled the cache through the recommended use of headers by putting this at the top of my pages:
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
What I can't find an answer to and it may be silly to ask, but this doesn't disable resources from caching either, does it? I was in my developer tools and looking at the network tab and noticed that the page was loading fresh every time, but resources such as CSS and Javascript were still loading from cache, which lead me to believe that preventing page cache doesn't also mean prevent page resources from being cached, but I don't know if that's actually true. So what I did was add some versioning to the resources like so:
<link rel="stylesheet" href="css/style.css?version=1">
That stopped the resource from being cached, which is what I wanted, but then after reading some more it appears that additional headers can be used to target certain file formats and stop them from being cached as well, which would yield the same results as the versioning, albeit a different way.
Is my understanding of this correct and/or is mixing methods bad practice?