# angularjs-query-cache

> cache response to queries made using the $http service

Latest version **1.0.2** (published 2018-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install angularjs-query-cache
pnpm add angularjs-query-cache
yarn add angularjs-query-cache
bun add angularjs-query-cache
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-03-02 |
| First published | 2018-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kareniel |
| Maintainers | kareniel |
| Keywords | angularjs, $http, http, query, cache, caching, localStorage, request |

## Links

- npm: https://www.npmjs.com/package/angularjs-query-cache
- Repository: https://github.com/kareniel/angularjs-query-cache
- Homepage: https://github.com/kareniel/angularjs-query-cache#readme
- Issues: https://github.com/kareniel/angularjs-query-cache/issues
- npm.io page: https://npm.io/package/angularjs-query-cache

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-03-02
- 1.0.1 — 2018-02-23
- 1.0.0 — 2018-02-16

## README

# angularjs-query-cache

<div align="left">
  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-unstable-green.svg?style=flat-square"
      alt="API stability" />
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/angularjs-query-cache">
    <img src="https://img.shields.io/npm/v/angularjs-query-cache.svg?style=flat-square"
      alt="NPM version" />
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/angularjs-query-cache">
    <img src="https://img.shields.io/npm/dm/angularjs-query-cache.svg?style=flat-square"
      alt="Downloads" />
  </a>
  <!-- Standard -->
  <a href="https://standardjs.com">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square"
      alt="Standard" />
  </a>
</div>

<br />

Sometimes you want to keep the result to a query you made previously.
This module decorates the $http service to add better caching.

This module uses sessionStorage which means restarting the browser will reset the cache.

## Usage

Set the `_cache` field to `true` in the `options` object when making a get request using $http. 
Optionally, you can see the max age (in milliseconds) on individual calls through the `_maxAge` key.


```js
var opts = { 
  _cache: true, 
  _maxAge: 5 * 60 * 1000 // <- this is the default value (5 minutes)
}

$http.get('https://api.my-service.io/endpoint', opts)
```

## Installation

Using npm:

`npm install --save angularjs-query-cache`

---
_Source: https://npm.io/package/angularjs-query-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
