Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser cache issues #223

Open
kticka opened this issue Dec 8, 2014 · 1 comment
Open

Browser cache issues #223

kticka opened this issue Dec 8, 2014 · 1 comment

Comments

@kticka
Copy link

kticka commented Dec 8, 2014

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.

@RomainLanz
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants