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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Needs review
mikeytown2’s picture

FileSize
1.02 KB

Committed the bug fixes; here is just the experimental part

mikeytown2’s picture

FileSize
928 bytes

Only needed to comment out one line

mikeytown2’s picture

FileSize
1.13 KB

Let 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.

mikeytown2’s picture

FileSize
960 bytes

and we are back to #3

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

Reports have been good. Going to add this in soon.

bgm’s picture

mgifford’s picture

There'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

bgm’s picture

Status: Reviewed & tested by the community » Needs review

Interesting!

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.