Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When returning back to a page you have already visited & nothing has changed, Apache could return a 304 instead of a 200. This mean it would use the browser cache. I've tested this locally on my box and it appears to work with no issues. Feedback on this is would be appreciated. Etag is built from the files modification time and file size. If either one of these change then browser will request the full page.
Patch below
Comment | File | Size | Author |
---|---|---|---|
#5 | boost-etag-only.patch | 960 bytes | mikeytown2 |
#4 | boost-etag-only.patch | 1.13 KB | mikeytown2 |
#3 | boost-etag-only.patch | 928 bytes | mikeytown2 |
#2 | boost-etag-only.patch | 1.02 KB | mikeytown2 |
boost-etag-only.patch | 1.49 KB | mikeytown2 | |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedComment #2
mikeytown2 CreditAttribution: mikeytown2 commentedCommitted the bug fixes; here is just the experimental part
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedOnly needed to comment out one line
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedLet browser keep for 5 seconds; no need to ask again for 304. - eventually make this configurable... something to do with min cache lifetime; set the max to 15 minutes as setting this too high can be very dangerous, but having this set is very powerful in terms of sites speed. Ctrl-F5 will bypass this.
unset Last-Modified header.
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commentedand we are back to #3
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedReports have been good. Going to add this in soon.
Comment #7
bgm CreditAttribution: bgm commentedMarked #982212: Cache-Control no-store, no-cache in Headers. Why? as a duplicate of this issue.
Comment #8
mgiffordThere's a discussion going on about ETags in Core now #1573064: Remove unique ETag hack as it is no longer necessary
I'd think this is the defined best practice - http://developer.yahoo.com/performance/rules.html#etags
Comment #9
bgm CreditAttribution: bgm commentedInteresting!
I think that in Boost we can rely on ETags generated by Apache, either from the filesystem inode, or the mtime (depending if in a cluster or not), since the cache is on the filesystem (unlike Drupal core).
If we rely on etags and do not impose "must-revalidate", we need to make sure that after a user login, the browser does not still serve pages from its cache, otherwise users have to reload each page after login.
Moving issue back to "needs review" since we should do more testing before committing this.