Disable the HTTP cache by default
Review Request #6901 — Created Feb. 4, 2015 and submitted
Previously, the Review Board server was not generating correct caching
information, resulting in the client side cache not being updated correctly.
Now that it has been fixed server side, the RBTools client needs to perform a
version check to see if the cache should be disabled.The HTTP cache is now disabled by default and will be enabled upon the first
request to the root resources (/api/
), which contains the version number of
the server, if the server is at least the minimum supported version. Currently
the minimum supported version is 2.0.13.The
Transport
class and its subclasses now have the machinery available to
enable the API cache.The HTTP cache for the API now appends both
If-None-Match
and
If-Modified-Since
headers if caching information for both is stored.
Prevously, only one of those headers would be used.
Ran unit tests.
Ran
rbt status -d
againsthttps://reviews.reviewboard.org
and saw that the
request to the/api/
endpoint did not cause a caching logging message, but
all subsequent requests did. This is the expected behaviour as the server is
currently in version 2.1 alpha 0 (dev).
- Change Summary:
-
Fixups.
- Commit:
-
e61845630f8408262831e356fbc66478cc8f80b47b52378883e5b2170a4a1b68d50939a7f7f39047
-
Tool: Pyflakes Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/api/resource.py rbtools/api/cache.py rbtools/api/transport/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/api/resource.py rbtools/api/cache.py rbtools/api/transport/__init__.py