I recently came upon a situation where I was using php and ajax to open a 'modal' after button click. I could not for the life of me understand why the dynamic content inside the modal was not updating after the first time it was clicked.
I changed this to the following and now all was fine :
<FilesMatch "\.(html?|php)$"> ExpiresDefault "access plus 0 seconds" Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0" Header set Pragma "no-cache" </FilesMatch>
I had looked up some information on proper 'nocache' settings and did a simple copy paste.
This, however, bought up the question... what is the difference between 'Header set' and 'Header append'?
From a working standpoint I see no difference. I changed new code to append and it worked fine. I have used append in these rules for years not thinking twice until now. I did some searching and didn't come across much.
What is the difference between these two? Logic of course says one is appended (added to the end), but what is the real difference here?
You can think of it as analogous to [QSA] in mod_rewrite. With "Header append" you will potentially end up with two different values for the same thing. And then the recipient-- in this case the browser-- has to decide which one to use. So if your existing Cache-control and/or Pragma header already has a default value that's different from what you're now saying, the browser might choose to go with the first thing it sees.