Open netsafe opened 9 years ago
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.
We may also want to consider adding a Last-Modified
header
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
Fixing issue #42 added the header : Cache-Control: private, max-age=3600