Skip to content

Fix issue 42 - Add HTTP Cache-Control headers#60

Open
netsafe wants to merge 10 commits intodanwent:masterfrom
netsafe:fix_issue_42
Open

Fix issue 42 - Add HTTP Cache-Control headers#60
netsafe wants to merge 10 commits intodanwent:masterfrom
netsafe:fix_issue_42

Conversation

@netsafe
Copy link
Copy Markdown

@netsafe netsafe commented Jun 20, 2015

Fixing issue #42 added the header :
Cache-Control: private, max-age=3600

@daveschaefer
Copy link
Copy Markdown
Collaborator

Thanks Alexey, I think this would be good. I'd like to test that clients using the Force Notary Check option always get the most recent results; we might need to add an "ignore cache" option in that case.

Thanks for putting your code in separate branches :) It looks like several changelists are duplicated in each branch. That's fine; I'll likely just cherrypick them out rather than merging this entirely through the github interface.

@daveschaefer
Copy link
Copy Markdown
Collaborator

We may also want to consider adding a Last-Modified header

@daveschaefer daveschaefer changed the title Fix issue 42 Fix issue 42 - Add HTTP Cache-Control headers Jun 24, 2015
@netsafe
Copy link
Copy Markdown
Author

netsafe commented Jun 24, 2015

Last-Modified is good, but in conjunction with Expires only... The problem is, that inside a notary code you can not know when the next scanner run will be performed : it can be launched in a separate server by the way, if they're using the same SQL database and memcached instances. So Last-Modified will add clearance for sure, but will not save the day alone. Using nginx with memcached support will do what you want : I've implemented a cache deletions in a threaded_scanner.py so the data in memcached will be invalidated for both notary and nginx - it will be just destroyed by key. And neither nginx cache, nor nginx-memcached will find a stale answer, and - notary uses the same memcached and it will find no stale data either, so it will be forced to re-query the DB backend to pull out a fresh valid information. That how it works

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants