Disable the HTTP cache by default

Review Request #6901 — Created Feb. 4, 2015 and submitted

brennie
RBTools
release-0.7.x
7b52378...
rbtools

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 against https://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).

  • 0
  • 0
  • 4
  • 0
  • 4
Description From Last Updated
reviewbot
  1. 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
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/cache.py (Diff revision 1)
     
     
     
     

    Two blank lines here.

    Also, constants typically go before non-constants.

  3. rbtools/api/cache.py (Diff revision 1)
     
     
     

    Blank line between these.

  4. rbtools/api/request.py (Diff revision 1)
     
     

    Can you add a docstring?

  5. rbtools/api/resource.py (Diff revision 1)
     
     

    This should go below the plain import.

  6. 
      
brennie
reviewbot
  1. 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
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (03dbc9e)
Loading...