 
     return service
 
+
+init = ($cacheFactory, $http) ->
+    $http.defaults.cache = $cacheFactory("httpCache", 512);
+
 module = angular.module('taiga.services.resource', ['taiga.config'])
+module.run(["$cacheFactory", "$http", init])
 module.factory('resource', ['$http', '$q', '$gmStorage', '$gmUrls', '$model', 'config', '$rootScope',
                             '$i18next', '$filter', '$log', ResourceProvider])


    service.getIssueTypes = (projectId, filters={}) ->
        parameters = _.extend({}, filters, {project:projectId})
        return queryMany("choices/issue-types", parameters)

    service.createIssueType = (form) ->
        return $model.create("choices/issue-types", form)


    service.getPriorities = (projectId, filters={}) ->
        parameters = _.extend({}, filters, {project:projectId})
        return queryMany("choices/priorities", parameters, {cache:true})

    service.createPriority = (form) ->
        return $model.create("choices/priorities", form)
