background preloader

PuPHPet - Online GUI configurator for Puppet & Vagrant

PuPHPet - Online GUI configurator for Puppet & Vagrant

Backbone.js Tips And Patterns HTTP Caching using JAX-RS | anirudh bhatnagar In the last blog we discussed different types of caches and their use cases. In this post we will explore how we can leverage caching using HTTP response headers and the support provided by JAX-RS.Expires Header In HTTP 1.0, a simple response header called Expires would tell the browser how long it can cache an object or page. It would be a date in future after which the cache would not be valid. So, if we made an API call to retrieve data : The response header would be: This means the XML data is valid until 25th Aug 2013, 16:00 hours GMT. JAX-RS supports this header in javax.ws.rs.core.Response object. But to support CDNs, proxy caches and revalidations there was a need for more enhanced headers with richer set of features, having more explicit controls. Cache-Control Cache-Control has a variable set of comma-delimited directives that define who,how and for how long it can be cached. JAX-RS provides javax.ws.rs.core.CacheControl class to represent this header. Like this: Like Loading...

Related: