I have the following question / problem:
I know that if I append something like "?v=*" in my Javascript includes such as
<script src="/js/myJsFile1.js?v=1.1" type="text/javascript"></script> I can force a client side recaching.
Now my question is, if I have a fragment such as the following in an example.php...
<?php ... ?>
<script>
var a = 5;
callRandomFunction();
</script>
...is there a need to have a version-control for this fragment as well?
As it is included in a PHP File and therefore always called from the server anyway, does a forced caching make sense here?
If it does - Is there some similar way as there is with the "?v=" appendix?
A few points of confusion:
So, the question comes down to:
Will my HTML page be cached?
The answer depends on cache headers, which are a surprisingly complicated part of HTTP. But the short version is that PHP will generally set headers telling the browser not to cache pages it generates.
So the really short answer is: no, you don't need to do anything.