Closed pushred closed 11 years ago
Using Last-modified
instead of ETags is preferred by Edgecast. I'd second that preference because it's actually informative.
What page were you looking at that had such unstable ETags?
The ETags seem fairly consistent, but they do change every once in a while with no easily discernable changes. I'm thinking changes in the context or its processing (which are generally passed to the page proper via solidus.context
) cause the ETag to be invalidated fairly often.
Ahh, that makes sense. In the case of http://keithurban.review.sparkart.com I'm getting a new ETag on every page load, probably because of the relative date calculation happening here:
var now = new XDate(true);
var seconds = parseInt( utcDatetime.diffSeconds( now ) ),
minutes = parseInt( utcDatetime.diffMinutes( now ) ),
hours = parseInt( utcDatetime.diffHours( now ) ),
days = parseInt( utcDatetime.diffDays( now ) );
In the case of http://bravado.review.sparkart.com you're calling underscore's shuffle. http://www.sparkart.com is mostly static though aside from the Kippt resource, as long as that doesn't change I'm only seeing 2 ETags in the mix — 1 for each Servo that I'm being tossed between.
Behavior-wise this is reasonable and perhaps even necessary in some cases where such to-the-second variability may be needed. But does a developer even have any tools to control this when writing their code other than eliminating any such randomizing/time relative code?
Is it possible to override the ETag Express sets with one such as the 5 minute interval set in #54?
ETag
can be set manually to whatever we want it to be. Famously, it was used to create secret tracking cookies for advertisers in the past. This is probably why it's fallen out of favor and it ultimately ignored these days.
@pushred are we still having these issues?
I think we're good!
ETags set for pages currently change on every page load. For example:
This means that the efforts of cache mechanisms are thwarted because we're telling them the content is constantly changing even if it isn't. We're missing Expires/Cache-Control headers currently however (#54) so in the case of Edgecast at least the pages are being cached for 7 days, masking this issue.
ETags should only be updated when resource data changes or a site is redeployed.