-
-
Notifications
You must be signed in to change notification settings - Fork 199
cached decorator takes query_string parameter #35
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
cached decorator takes query_string parameter #35
Conversation
Provide a keyword `query_string` to `cached` decorator in order to create the same cache key for different query string requests, so long as they have the same key/value (order does not matter). Create tests for aforementioned. However, I was having troubles getting tests to run locally `EOFError: Ran out of input`, but we'll see the results on Travis CI pop up soon!
Looks like there's an error for Python 3.5 (though this feature works for Python 3.5.2 on the https://github.com/opensyllabus/osp-api project and is tested). I believe the errors below are unrelated to my changes (it passes for two other versions of Python on Travis CI):
|
Thanks, I appreciate it! |
My pleasure @sh4nks! Thanks for being so communicative and expedient! |
with any cache-able resource response. The time in the response | ||
can verify that two requests with the same query string | ||
parameters/values, though differently ordered, produce responses | ||
with the same `cache_timestamp`. |
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.
The same time, not cache_timestmap
.
* GET /v1/works?limit=15&mock=true&offset=20 | ||
|
||
Caching functionality is verified by time from response included | ||
with any cache-able resource response. The time in the response |
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.
verified by a @cached
route /works
which produces a time in its response.
I have updated the docstring - I think it's fine now. |
btw, I have pushed version 1.3.0 to pypi. |
@sh4nks That's wonderful! I'll use that on |
Provide a keyword
query_string
tocached
decorator in orderto create the same cache key for different query string requests,
so long as they have the same key/value pairs (order does not matter).
Create tests for aforementioned.