Opened 12 years ago
Last modified 12 years ago
#266 closed defect (FIXED)
Improve cache friendliness of static content
|Reported by:||Elrond||Owned by:||Christopher Allan Webber|
If not serving the (semi-)static content (css etc and the media items) through a dedicated webserver but using paste#static the caching is bad. It could easily be argued, that on a real deployment, these tings should be served by a dedicated webserver. But still, the paste based setups should give reasonable caching. There are two items to consider: 1. mediagoblin/mgoblin\_static/ (CSS, ...) Only layout/etc developers will change this and those will likely use "reload" on their browsers anyway. Everybody else will only change this when updating their install. So even thinking about people updating and wanting a fresh look soon, at least an hour would be good. I'd rather suggest a day. 2. media content (public\_store) media items aren't **modified** currently. They get written once and stay there as written. Creating a new media entry, creates a new object id, etc. I'd say a week is good.
Change History (8)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I'll happily push a branch, if someone wants me to.
comment:3 by , 12 years ago
Hm. I have a pretty significant concern with this, and that's memory bloat. Imagine you're serving a .webm file... wouldn't that bloat your memory keeping that cached really fast? What if you're serving 10? ;) I do think it's best that we serve this stuff through apache and etc... I do also agree that a lot of people won't configure things right from the get-go, and so we should provide sane defaults. How about a compromise... we keep commented-out versions of those options in the file, with a comment above them explaining "uncomment these to enable simple python-side caching"?
comment:4 by , 12 years ago
These options do not affect memory on the server(!) in any way. They affect cache on the client. They tell the client: The content it just received will not change in the next N seconds. Nothing more, nothing less. Client decides how to use this info. Clients usually cache this stuff and decide not to ask the server over and over again for the same file. Good. Saves network bandwidth. Over simplifications used above: 1. The **config** will take a few bytes of ram on the server. 2. I'd guess, proxy servers are allowed to cache too.
comment:5 by , 12 years ago
Talked to chris. We'll do like I suggested. I'll push a branch (assigned to me for that reason).
comment:6 by , 12 years ago
|Status:||New → Feedback|
New branch: misc/f602\_client\_cache\_improvement
comment:7 by , 12 years ago
|Status:||Feedback → Closed|
comment:8 by , 11 years ago
The original url for this bug was http://bugs.foocorp.net/issues/602 .
Note: See TracTickets for help on using tickets.