|
This is a very simple javascript object cache, with about 20 line code. DependencePrototype 1.6.1+ How toInstallationDownload and link prototype.js and jscache.js in your html header as <script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="jscache.js"></script> ConfigurationYou do not need any configuration UsageStore something in cache: var data = [1,2,3];
JSCache.put("mydata", data);Get something from cache: var data = JSCache.get("mydata");Remove something in cache: JSCache.remove("mydata");Clear all cache: JSCache.reset(); That's all.
|