Question: To add caching inside http is pretty straight forward. ( by passing cache=true )

[http://docs.angularjs.org/api/ng.$http](https://docs.angularjs.org/api/ng/service/$http) has Cache option.

How do I add similar functionality in $resource in angularjs ?

Answer: 
Since 1.1.2 ([commit](https://github.com/angular/angular.js/commit/af89daf4641f57b92be6c1f3635f5a3237f20c71)), all the $httpConfig options are directly exposed in $resource action objects:

```
return {
  Things: $resource('url/to/:thing', {}, {
    list : {
      method : 'GET',
      cache : true
    }
  })
 };

```
Implementing your own cache in AngularJs is quite easy. Just use [$cacheFactory](http://docs.angularjs.org/api/ng.%24cacheFactory):

```
app.factory('myService', function($resource, $cacheFactory) {
   var cache = $cacheFactory('myService');
   var User = $resource('/user/:userId', {userId:'@id'});

   return {
      getResource: function(userId) {
         var user = cache.get(userId);
         if (!user) {
            user = User.get({userId:userId});
            cache.put(userId, user);   
         }
         return user;
      }
   };
});

```