2

I have an angular app which talks to my rails api via ng resource. In my response I set etag in my header which I get in my response headers but while making the same query again If-None-Match header is not set and in turn my caching doesn't works whereas when i make requests directly via the browser it works correctly. How can I set the received etag in my request headers with $resource

ptwo
  • 461
  • 4
  • 13

1 Answers1

1

$resource doesn't natively support etags, one way of doing it is using $cachefactory and interceptors. I did a similar thing for a project but your mileage may vary.

For a better solution look at Restangular or angular-data.

mxp
  • 180
  • 6