Cache an HTTP 'Get' service response in AngularJS?
问题 I want to be able to create a custom AngularJS service that makes an HTTP \'Get\' request when its data object is empty and populates the data object on success. The next time a call is made to this service, I would like to bypass the overhead of making the HTTP request again and instead return the cached data object. Is this possible? 回答1: Angular's $http has a cache built in. According to the docs: cache – {boolean|Object} – A boolean value or object created with $cacheFactory to enable or