Opened 8 years ago

Last modified 5 years ago

#674 assigned enhancement

Give better caching directives for static files in web interface

Reported by: Nicolas Owned by:
Priority: minor Milestone: 0.9.+
Version: Keywords: web
Cc: rutsky.vladimir@…

Description

It looks like my web browser is requesting /default.css and /bg_gradient.jpg every single time I switch to a new page. Even if I use back and forward buttons, which don't cause the page to be requested again, it still requests again those two files.

The requests properly use If-Modified-Since, and buildbot properly replies with 304 Not Modified, but it's still annoying. Clutters the webserver log, for one.

According to redbot, the responses are “stale” as soon as they go out. They should have an appropriate Expires header, or Cache-Control: max-age=3600 (1 hour expiration from now).

Change History (8)

comment:1 Changed 8 years ago by marcusl

  • Owner set to marcusl
  • Status changed from new to accepted

Right, we should probably add a 'media' directory where static content go (css/images) and export all that with an expires header.

Since I run buildbot proxied behind apache, I add expires headers in apache's config file, but that wont work when running twistd.

comment:2 Changed 8 years ago by marcusl

  • Priority changed from trivial to minor

comment:3 Changed 8 years ago by dustin

  • Milestone changed from undecided to 0.8.+

comment:4 Changed 8 years ago by marcusl

  • Owner marcusl deleted
  • Status changed from accepted to assigned

I'm not really sure how to fix this a.t.m. so I'm unaccepting it until myself or someone else tackles it properly.

comment:5 Changed 8 years ago by dustin

  • Keywords web added; jinja removed
  • Milestone changed from 0.8.+ to 0.8.1

comment:6 Changed 8 years ago by dustin

  • Milestone changed from 0.8.2 to 0.8.3

comment:7 Changed 8 years ago by dustin

  • Milestone changed from 0.8.3 to 0.9.+

This will be even more important when serving a lot of static JS

comment:8 Changed 5 years ago by rutsky

  • Cc rutsky.vladimir@… added
Note: See TracTickets for help on using tickets.