Closed
Bug 605647
Opened 14 years ago
Closed 14 years ago
Statistics csv/json files should have hashes in their URL
Categories
(addons.mozilla.org Graveyard :: Code Quality, defect, P3)
addons.mozilla.org Graveyard
Code Quality
Tracking
(Not tracked)
VERIFIED
FIXED
5.12.3
People
(Reporter: clouserw, Assigned: andy+bugzilla)
Details
We have far future expires headers on our CSV and JSON exports, which is a great idea until our stats export fails one day and we have zeroes cached forever.
We should be doing a simple hash (how many rows, sum of numbers, whatever it takes to make it unique) and tacking it on the end of the URL. Hopefully it never changes.
Reporter | ||
Updated•14 years ago
|
Assignee: nobody → amckay
Priority: -- → P3
Reporter | ||
Comment 1•14 years ago
|
||
Let's do this:
1) If the numbers (you pick which ones! :) are zeroes, send a no cache header
2) Make sure the expires header is only for +7 days
Assignee | ||
Comment 2•14 years ago
|
||
Don't think looking for zeroes is useful, we need to be looking for absence of data.
https://github.com/jbalogh/zamboni/commit/4f93312b8bea2f75c6306eb60608edf201b2ae05
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 3•14 years ago
|
||
Neither https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.csv nor https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.json have no missing data (that I can tell), and yet, I'm not seeing the Expires: header:
Access-Control-Allow-Methods:GET
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Connection:Keep-Alive
Content-Encoding:gzip
Content-Type:text/plain; charset=utf-8
Date:Wed, 17 Nov 2010 23:42:41 GMT
Keep-Alive:timeout=5, max=1000
Server:Apache
Transfer-Encoding:chunked
Vary:Accept-Encoding
Via:Moz-Cache-pm-zlb-amo01
X-Backend-Server:pm-app-amo24
x-content-security-policy-report-only:policy-uri /services/csp/policy
x-frame-options:DENY
Am I testing this correctly?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 4•14 years ago
|
||
Yeah, those should have Expires headers, not sure what's going on. We can bump this to .4 if we need to - these URLs aren't live.
Assignee | ||
Comment 5•14 years ago
|
||
Not able to reproduce yet:
~/sandboxes/zamboni(master) $ curl -D out.txt https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.json > /dev/null
...
~/sandboxes/zamboni(master) $ grep Cache out.txt
Cache-Control: max-age=604800
Assignee | ||
Comment 6•14 years ago
|
||
Betting you were logged in, getting different answers depending upon login status.
Comment 7•14 years ago
|
||
Zeus is modifying the cache headers if you're logged in.
(zamboni)$ curl -sI https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.json A Cache-Control
Cache-Control: max-age=604800
(zamboni)$ curl -H'Cookie: sessionid=me' -sI https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.json A Cache-Control
Cache-Control: no-cache
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•14 years ago
|
||
With help from Jeff, we think the following is happening. Zeus sees that the
user is logged in because it has the cookies AMOv3 (remora) and sessionid
(zamboni). It then disables caching because logged in users are not cached.
This alters the cache headers.
Presumably we can alter Zeus not to do that on certain URLs to preserve
caching.
A valid test at this point is:
https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20101018-20101117.json
data and so Cache-Control: max-age=604800 set
https://addons-next.allizom.org/z/en-US/firefox/addon/1865/statistics/downloads-day-20301018-20301117.json
no data and so Cache-Control: max-age=0 set
But this has to be done as an anonymous user.
Comment 9•14 years ago
|
||
Thanks, Andy -- followed those steps in comment 8 (while logged out), and it's verified FIXED.
Would you mind spinning off an IT bug for the Zeus tweaking?
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 10•14 years ago
|
||
right now it's:
if logged_in:
dont_cache()
we can adjust this to be:
if cache_control_header:
respect_the_header()
else if logged_in:
dont_cache()
Anyone see a reason not to do that?
Assignee | ||
Comment 11•14 years ago
|
||
Sounds good to me.
Reporter | ||
Comment 12•14 years ago
|
||
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•