-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forward etag and cache-control (and set proper mime) for /issues/lables.
- Loading branch information
Mike Taylor
committed
Aug 28, 2014
1 parent
7667be3
commit f5ef429
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f5ef429
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks almost good. ;)
Host: webcompat.com
,GET /issues/labels
FLask-serverHost: api.github.com
,GET repos/webcompat/labels
and caches the answerHost: webcompat.com
,GET /issues/labels
with ETAG in the requestIf-None-Match:
@cache.cached(timeout=600)
(application cache != web cache), but ETAG does nothing here.The issue: The ETAG aka
If-None-Match:
is not sent to GitHub in the raw_request, which means github doesn't know if it should send you a 304 Not Modified or a 200 OKIt's the tricky part of WebCompat being an intermediary proxy which is sometimes acting as a server and sometimes as a client.
I'm not sure it will work how you intend it to work.
f5ef429
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to fix:
After the step 8:
If-None-Match
from the JS-client requestIf-None-Match
and the value we capturedNote that in this case the cache timeout might get into the way. If the labels have been changed in the last 600s since the last time the function has been called it will send back the application cached label view (!= web cache). Also, I wonder how the Flask cache is working with private information, I guess it doesn't matter because there is only one authenticated user which is webcompat account.
f5ef429
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰