API reference

Client-Side Caching

Client-side caching allows a client application to keep a local copy of a structure and only update it if the server indicates that a newer version is available.

Caching is managed through HTTP headers: the URN Resolver provides information in response headers, and the client provides information in request headers.

HTTP Response Headers

ETag

The ETag is a string generated from a hash of the resolved structure. The hash only changes if the content of the structure changes.

Clients can use this value in the If-None-Match request header to tell the server: “only return the structure if your copy has a different hash than mine.”

Last-Updated

The Last-Updated header indicates the most recent time the structure was modified on the server.

Note that this timestamp reflects the last detected content change, not the last time the structure was requested from the target web service.

HTTP Request Headers

If-None-Match

The client includes an If-None-Match header with the ETag value it previously received.

  • If the server’s hash differs from the client’s, the updated structure is returned.
  • If the hash matches, the server responds with HTTP 304 – Not Modified.

If-Modified-Since

The client includes an If-Modified-Since header with a timestamp.

  • If the structure has changed since that time, the updated structure is returned.
  • If not, the server responds with HTTP 304 – Not Modified.
Previous
HTTP Status Codes