-
-
Notifications
You must be signed in to change notification settings - Fork 487
Closed
Description
I'm unsure if this is intended or just by consequence. I found this while writing up some tests for a Betamax-like package for python's httplib, and I was comparing responses with those from praw for the sake of ease.
I'll split this up into three scenarios:
- No authentication: The first request "is" cached by the handler, however reddit adds the "__cfduid" (I don't know what this does from a cursory look), "loid" (logged out id cookie for A/b tests), and "loidcreated" (timestamp of the LOid cookie creation so that reddit can change your variant test after a set amount of time) cookies to the requests Session cookiejar. Because of this, a request to the same url right after this does not read from the cache (as the cookies do not match, obviously).
- OAuth2 authentication: Same as scenario 1, except it's not the first request, it's the first request after authenticating.
- Login authentication: Same as scenario 1, except "reddit_session" and "secure_session" cookies are also added.
Sometimes a session_id cookie is also added, however this seems to be for anonymous tracking purposes and doesn't occur all the time.
Regardless the addition of these cookies make it so that the initial request, when stored in the DefaultHandler's cache, would never be retrieved from the cache (unless you manually manipulate the cookiejar)
Metadata
Metadata
Assignees
Labels
No labels