PHPackages                             etdsolutions/jquery-ajax-localstorage-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. etdsolutions/jquery-ajax-localstorage-cache

ActiveLibrary

etdsolutions/jquery-ajax-localstorage-cache
===========================================

Store ajax responses using the browser's local storage cache

017

Since Nov 26Pushed 10y ago2 watchersCompare

[ Source](https://github.com/etd-framework/jquery-ajax-localstorage-cache)[ Packagist](https://packagist.org/packages/etdsolutions/jquery-ajax-localstorage-cache)[ RSS](/packages/etdsolutions-jquery-ajax-localstorage-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Jalc
----

[](#jalc)

jquery-ajax-localstorage-cache - abbreviated Jalc from here on, because the full name is a mouthful.

Jalc is a plugin built for jQuery (&gt; 1.5.1) and any object implementing the [storage interface](https://developer.mozilla.org/en-US/docs/Web/API/Storage), such as [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).

It's built on a fork from the [jStorage-dependent original](https://github.com/nectify/jquery-ajax-jstorage-cache). It provides a client-side cache for AJAX responses intended to save bandwith and time.

Usage
=====

[](#usage)

Parameters
----------

[](#parameters)

```
	$.ajax({
		url          : '/post',
		localCache   : true,        // Required. Either a boolean, in which case localStorage will be used, or
		an object that implements the Storage interface.

		cacheTTL     : 1,           // Optional. In hours.
		cacheKey     : 'post',      // optional.
		isCacheValid : function(){  // optional.
			return true;
		}
	}).done(function(response){
	    // The response is available here.
	});
```

On your AJAX request you get 4 new parameters :

- localCache
    - Turn localCache on/off, or specify an object implementing the Storage interface to use.
    - Default: false
- cacheTTL
    - time in hours the entry should be valid.
    - only for this specific ajax request
    - Default : 5 hours
- cacheKey
    - CacheKey is the key that will be used to store the response in localStorage. It allow you to delete your cache easily with the localStorage.removeItem() function.
    - Default: URL + TYPE(GET/POST) + DATA
- isCacheValid
    - This function must return true or false. On false, the cached response is removed.
    - Default: null

Notes
-----

[](#notes)

- You can delete the cache by using `localStorage.clear()`, or by using `localStorage.removeItem('cacheKey')`if you specified a cacheKey. Note the above assumes you're using localStorage - replace as appropriate with your Storage interface implementing object.
- Note that you can pre-load content with this plugin. You just have do to an initial AJAX request with the same cacheKey.

License
=======

[](#license)

This project is distributed under Apache 2 License. See LICENSE.txt for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e7eb34b24e7571bbea55031b72d8ff30182da0473df0ade681211ce20c7ebf2?d=identicon)[jbanety](/maintainers/jbanety)

---

Top Contributors

[![paulirish](https://avatars.githubusercontent.com/u/39191?v=4)](https://github.com/paulirish "paulirish (11 commits)")[![SaneMethod](https://avatars.githubusercontent.com/u/1050612?v=4)](https://github.com/SaneMethod "SaneMethod (9 commits)")[![caleywoods](https://avatars.githubusercontent.com/u/402957?v=4)](https://github.com/caleywoods "caleywoods (5 commits)")[![jbanety](https://avatars.githubusercontent.com/u/1055330?v=4)](https://github.com/jbanety "jbanety (4 commits)")[![softwarespot](https://avatars.githubusercontent.com/u/5333690?v=4)](https://github.com/softwarespot "softwarespot (3 commits)")[![iRyusa](https://avatars.githubusercontent.com/u/570317?v=4)](https://github.com/iRyusa "iRyusa (3 commits)")[![robink](https://avatars.githubusercontent.com/u/116530?v=4)](https://github.com/robink "robink (2 commits)")[![basicallydan](https://avatars.githubusercontent.com/u/516325?v=4)](https://github.com/basicallydan "basicallydan (2 commits)")[![shaqq](https://avatars.githubusercontent.com/u/1438493?v=4)](https://github.com/shaqq "shaqq (2 commits)")[![tronhammer](https://avatars.githubusercontent.com/u/974489?v=4)](https://github.com/tronhammer "tronhammer (1 commits)")[![bshelton229](https://avatars.githubusercontent.com/u/169958?v=4)](https://github.com/bshelton229 "bshelton229 (1 commits)")[![dguzzo](https://avatars.githubusercontent.com/u/571624?v=4)](https://github.com/dguzzo "dguzzo (1 commits)")[![mludv](https://avatars.githubusercontent.com/u/750438?v=4)](https://github.com/mludv "mludv (1 commits)")[![NigelKibodeaux](https://avatars.githubusercontent.com/u/408692?v=4)](https://github.com/NigelKibodeaux "NigelKibodeaux (1 commits)")[![sunnokon](https://avatars.githubusercontent.com/u/4680023?v=4)](https://github.com/sunnokon "sunnokon (1 commits)")

### Embed Badge

![Health badge](/badges/etdsolutions-jquery-ajax-localstorage-cache/health.svg)

```
[![Health](https://phpackages.com/badges/etdsolutions-jquery-ajax-localstorage-cache/health.svg)](https://phpackages.com/packages/etdsolutions-jquery-ajax-localstorage-cache)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
