Cache Control

A no-cache directive (Cache-Control: no-cache, no-transform) is returned in responses by default, precluding proxies and caches from caching or transforming responses. This may be customized in the following manner:

  1. System default property in the general restsql properties file
    The following example sets the maximum age to 60 seconds and precludes proxy transformation:
       # http.response.cacheControl={cache-directive}, {cache-directive}, ...
       http.response.cacheControl=max-age=60, no-transform
    	
  2. Override on a per SQL Resource basis in the definition's metadata element

    The following example allows the UCI community to use an otherwise private response in their shared cache(s):
    <?xml version="1.0" encoding="UTF-8"?>
    <rs:sqlResource xmlns:rs="http://restsql.org/schema"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://restsql.org/schema SqlResource.xsd ">
       <query>
          ...
       </query>
       <metadata>
          ...
       </metadata>
       <http>
          <response cacheControl='private, community="UCI"' />
       </http>
    	

Note: Cache control directives on requests are ignored.

See Section 14.9 of RFC 2616 for more detail on cache control.