Closed
Bug 662116
Opened 14 years ago
Closed 13 years ago
Optimizaton: Set proper Cache-Control for JS and CSS files
Categories
(Pancake Graveyard :: Back-end, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
M2
People
(Reporter: st3fan, Assigned: gbrander)
Details
Cache static assets like js and css on the client.
Ideally we reference these in the code with a version number or time stamp attached. Like /js/main.js?v=28372372992. That way it is easy to force an expiration on the client.
This timestamp can be updates automatically every deployment if we turn index.html back into a template.
Reporter | ||
Updated•14 years ago
|
Assignee: nobody → sarentz
Reporter | ||
Comment 1•14 years ago
|
||
Reporter | ||
Comment 2•14 years ago
|
||
I set the js/css/png files to expire after a day. The only request I see now when loading the site is on /api/top so that is pretty good.
Comment 3•14 years ago
|
||
Cool. That should be enough to get decent performance. The front end also caches the /api/search results for 5 minutes to reduce network traffic.
Reporter | ||
Comment 4•14 years ago
|
||
So this seems to work as expected on Safari and Firefox on the desktop but completely fails in Mobile Safari on the iPad. Have to figure out why it behaves different.
Comment 5•14 years ago
|
||
They probably don't have any disk cache, like Fennec.
Reporter | ||
Comment 6•14 years ago
|
||
Found this .. http://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/
Sucks. Maybe we can improve things in the native wrapper.
Reporter | ||
Comment 7•14 years ago
|
||
I think this is done. Needs some real world testing. If it needs to be tuned then we can reopen this bug.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•13 years ago
|
||
We're having asset caching issues with the current build of the app.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 9•13 years ago
|
||
I'm going to take the simple approach of adding a cache-busting string to the config file. This can be automated at a later date.
See http://html5boilerplate.com/docs/Version-Control-with-Cachebusting/ for details on this technique.
Assignee: sarentz → gbrander
Target Milestone: --- → M2
Assignee | ||
Comment 10•13 years ago
|
||
Added cachebusting variable to config, passing to templates. Added ?v={{v}} to the end of static resources.
Commits:
https://bitbucket.org/mozillapancake/pancake/changesets/tip/branch%28%22cachebusting%22%29
Status: REOPENED → RESOLVED
Closed: 14 years ago → 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•