Asset caching #230

Closed
pivotal-medici opened this Issue May 22, 2012 · 7 comments

Projects

None yet

5 participants

@pivotal-medici

It seems that sometimes chrome is overly aggressive with caching static resources like script files. It would be nice is jasmine added a unique per run identifier similar to what rails does in production.

e.g.

<script src="/assets/foo-somethingunique1234.js" type="text/javascript"></script>
@ragaskar
Contributor

We did a file hash for cache-busting awhile ago but it ended up being pretty expensive. Are you on the latest 1.2.0? This has some newer header tags that should help. If that doesn't seem to be better, we can consider adding timestamped get params, but I'd like to avoid filename remapping if possible.

@pivotal-medici

Yeah we're on the latest 1.2.0. We're getting some really aggressive caching. It doesn't seem to be consistent. We have found that restarting the jasmine server clears the cached assets.

@infews
Contributor
infews commented May 27, 2013

Is this still an issue? Have you tried jasmine-gem HEAD of master? Between the tags that @ragaskar mentions and some architecture changes in the gem, we're not seeing caching thse days.

@rupurt
Contributor
rupurt commented May 28, 2013

We have been on 1.3.2 and still see it from time to time. I'll switch to master now and see if it makes any difference.

@slackersoft
Member

This should be better in 2.0. Please take a look and let us know if this is still an issue

@slackersoft slackersoft closed this Oct 2, 2013
@rupurt
Contributor
rupurt commented Oct 2, 2013

Do you know which commits might help?

@ragaskar
Contributor
ragaskar commented Oct 2, 2013

If you're using asset pipeline we should now include the fingerprint/md5 hash for asset pipeline assets. If you're not, there's no change, although we did introduce some caching directives awhile ago. If there's a demonstrable problem I'd prefer to fix those caching directives vs. adding hashing to files if possible. At one point jasmine did the latter and it was fairly slow/complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment