1602 / compound

MVC framework. Built on Node.JS. Works on server and browser.
http://compoundjs.com
1.6k stars 183 forks source link

How are js files merged? #621

Open alexiskattan opened 10 years ago

alexiskattan commented 10 years ago

I'm making a small change to one js file. In development mode everything is fine. However, when I push it to the server, even if a file is changed, the merged files are still getting the same name.

So even after a file is changed there production server is still serving:

<script type="text/javascript" src="/javascripts/cache_123.....123.js"></script>

So people have to clear their cache to get the new update, which is hard to explain...

In production.coffee I have:

app.enable 'merge javascripts'

Is there a way to less aggressively cache? Or a way to make it change the file name on every push?

anatoliychakkaev commented 10 years ago

Nope, it's not implemented at the moment. The fix is simple by the way: we should calculate cache name based on filename and mtime, not just filename.

On 21 April 2014 06:45, alexiskattan notifications@github.com wrote:

I'm making a small change to one js file. In development mode everything is fine. However, when I push it to the server, even if a file is changed, the merged files are still getting the same name.

So even after a file is changed there production server is still serving:

So people have to clear their cache to get the new update, which is hard to explain...

In production.coffee I have:

app.enable 'merge javascripts'

Is there a way to less aggressively cache? Or a way to make it change the file name on every push?

— Reply to this email directly or view it on GitHubhttps://github.com/1602/compound/issues/621 .

alexiskattan commented 10 years ago

It would be awesome if this is fixed. There are some issues that keep coming up with regards to it.

sagish commented 9 years ago

+1 on this, users do not get update CSS or JS in production unless they activley refresh the page

alexiskattan commented 9 years ago

omg. thank you.

alexiskattan commented 9 years ago

@anatoliychakkaev would it be possible to push this version to npm soon? Thank you so much again for the platform it is really wonderful.