New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ETag and Last-Modified #130

Merged
merged 5 commits into from Oct 2, 2018

Conversation

Projects
None yet
1 participant
@fluffy-critter
Collaborator

fluffy-critter commented Oct 2, 2018

Summary

Implements ETag and Last-Modified for cache control; resolves issue #129

Detailed description

For category and entry views, it generates a fingerprint and last-modified time of the most recent relevant file. The relevant files considered are:

  • The view template
  • The most recently-published entry (based on publish time, not file modification time)
  • The most recently-indexed file
  • The entry itself, if applicable

This is a pessimistic time stamp, the idea being that any modification to an entry might end up changing things like previous/next links or any sidebar showing recent changes or the like. This avoids having to do an expensive process of evaluating the template to see what related things have changed (which would defeat the entire purpose to this caching in the first place).

Test plan

Using feedparser I manually tested a number of scenarios, including modifying entries and scheduling an entry for the future and watching the tag and last-modified change when its future date is reached.

@fluffy-critter fluffy-critter merged commit f4522c0 into master Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment