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

Add md5sum and last_modified to cache entries #901

Open
jsabater opened this Issue Nov 11, 2018 · 0 comments

Comments

1 participant
@jsabater
Copy link

jsabater commented Nov 11, 2018

This is a request for the following attributes to be added to cache entries, as part of their details/metadata:

  1. md5sum: MD5 sum of the data, that is hashlib.md5(str(entry.value)).hexdigest(). Useful to generate and ETag header at the service.

  2. last_modified: HTTP-date version of last_write but generated once and synchronized as part of the metadata, so it is exactly the same value across the instances. Useful to generate a Last-Modified header at the service. Format is RFC2616 but it could also be stored as a timestamp. There are different ways to generate it. The one I am using right now in the services is this one:

from wsgiref.handlers import format_date_time
self.response.headers['Last-Modified'] = format_date_time(cache_entry.last_write)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment