This is the second time today, I ran into this problem: occasionally after I modified the template file (.html), the old template is still used. I tried multiple ways to solve this:
- refresh the page in browser;
- refresh the page in browser with ctrl+f5;
- even restarting Apache.
But the result seemed really inconsistent, and some time none of the above worked. I suspect this somehow relates to how the transpile is triggered.
How can I grantee that the transpile is triggered when the template is modified?
(Not sure whether the code matters in this case, but you can reference this question I asked earlier, the fixed version of that code was used. For exmple, if I change the placeholder to below, the mis-spelled "first" won't necessarily show up.)
placeholder="Enter firsttttta name here">
Update:
As @basarat pointed out in his comment, this was solved by adding the following to httpd.conf (I added ts|ts!transpiled to the list. ts is the file extension for typescript, and angular2 seemed to use ts!transpiled for transpiled script.)
<filesMatch "\.(html|htm|js|css|ts|ts!transpiled)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>