0

Want to know where exactly data will be cached in Restful Webservices? Please avoid saying browsers cache Restful webservices data.

kumar
  • 691
  • 1
  • 7
  • 16

2 Answers2

1

REST is based on HTTP. In HTTP you do not know if you data is cached somewhere. It may be in the browser or in any node in between the client and the server.

However your REST-Server may add the Cache-Control HTTP header to its response, e.g. Cache-Control: No-Cache to mark the response as not to cache.

It is not assured if this will not be ignored by a proxy or whatever.

Your client can also request to not cache data. In jquery you just add cache: no to the AJAX-request and it will do the trick. If jquery is not available you will have to use the if-modified-since header (http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#if-modified-since).

Martin Meeser
  • 2,784
  • 2
  • 28
  • 41
0

Probably this post cleared my doubt.

http://www.openlogic.com/wazi/bid/283625/Caching-web-service-results-can-enhance-Apache-application-performance.

kumar
  • 691
  • 1
  • 7
  • 16