in Uncategorized

Cache Invalidation

In the ideal world, what we see is the current. In the distributed software world, what we see may be stale. We can't tell. Would not it be nice to specify a cache invalidation API such that the source of the change can notify everyone that it changed? That is what an OpenSocial 1.0 draft aims to do.

Containers MUST support the invalidation endpoint even if they do not perform any caching and MUST provide an entry for it in their XRDS. To invalidate content a developer’s backend notifies the container of the content it wishes to invalidate by making a 2-legged OAuth call to the Cache service with one or many keys to be invalidated. The consumer key in the 2-legged OAuth call is used by the container to identify the calling application.

This text is followed by an example.

POST /api/rest/cache/invalidate HTTP/1.1
Host: api.example.org
Authorization: hh5s93j4hdidpola
Content-Type: application/json

{
  "invalidationKeys" : [ 
      "http://www.myapp.com/gadgetspec.xml", 
      "http://www.myapp.com/messagebundle.xml"
  ]
}

Excellent.

  • Related Content by Tag