Open kticka opened 9 years ago
I think that the better way to do that is to add a hash of all file at the end of the name application.css
and application.js
like Ruby On Rails do.
EDIT :
I just read the code, and the hash on the file is already that I said.
public function generateCacheKey($path, $lastModified, $salt = '')
{
return md5($path . $lastModified . $salt);
}
But, it's not write on the file which is send to the browser. Maybe add the key at the end?
How to avoid browser cache? When all css/js is concatenated, it generates 'application.css' and 'application.js' files, and then serve them to the browser. Concatenated file name is strictly related with manifest file, so if I want to change name of concatenated javascript file, I should change manifest file to. And I should do this in every deployment. There could be some option to pass concatenated file version or something like that and force browser to download new / updated javascript file.