Countdown banners are broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Website - OBSOLETE |
Fix Released
|
High
|
Matthew Nuzum |
Bug Description
The countdown banner does not work because a browser will cache its current state until Apache says it is modified (and sends a new one). This does not happen, because Apache doesn't say it is modified and does not send a new one.
Here are the headers sent with that image, according to Webkit's web inspector, on an average day looking at ubuntu.com:
Request URL:http://
Request Method:GET
Status Code:304 Not Modified
Request Headers
Cache-Control:
If-Modified-
Referer:http://
User-Agent:
Response Headers
Connection:
Date:Sun, 19 Sep 2010 15:14:57 GMT
Server:Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 PHP/5.2.
Via:1.0 privet.
X-Cache:MISS from privet.
X-Cache-Lookup:HIT from privet.
If I view the image do a complete refresh (equivalent to clearing my cache), I end up with the following:
Request URL:http://
Request Method:GET
Status Code:200 OK
Request Headers
Accept:
Cache-Control:
Referer:http://
User-Agent:
Response Headers
Accept-Ranges:bytes
Connection:
Content-Length:9627
Content-
Date:Sun, 19 Sep 2010 15:17:18 GMT
Last-Modified:Tue, 14 Sep 2010 15:45:07 GMT
Server:Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 PHP/5.2.
Via:1.0 jujube.
X-Cache:HIT from jujube.
X-Cache-Lookup:HIT from jujube.
Note the Last-Modified date. If the script that generates the image updates the last-modified date, this will work perfectly :)
Changed in ubuntu-website: | |
status: | New → Confirmed |
Changed in ubuntu-website: | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
Changed in ubuntu-website: | |
importance: | Undecided → High |
summary: |
- Countdown banner does not work. Server tells client to use cached - version + Countdown banners are broken |
We have tried adding cache-control headers to our proxy but as you've pointed out here, it does not appear to be enough. I've submitted a patch to our cron job that manages the symlinks to update the modified time of the image so that when the browser does an if-modified-since check the time the symlink was created will be used instead of the time the linked file was actually modified.
Let's hope this works! (browser caching is a challenging topic)