Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4123405
cache.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
cache.js
View Options
/* This module defines several types of cache classes to use in other
* modules.
* The interface, that all types use, is kept synchronous driven by current
* usage patterns, but will need to be revisited in case usage patterns
* suggest we need asynchronous caches.
*/
/**
* In memory cache implementation
*
* @class MemoryCache
* @private
*/
function
MemoryCache
()
{
this
.
_cache
=
{};
}
/**
* Retrieve a cached value from a key
*
* @memberof MemoryCache
* @instance
* @param {string} key
* @return {any}
*/
MemoryCache
.
prototype
.
get
=
function
(
key
)
{
return
this
.
_cache
[
key
];
};
/**
* Cache a value by key
*
* @memberof MemoryCache
* @instance
* @param {string} key
* @param {any} value
*/
MemoryCache
.
prototype
.
set
=
function
(
key
,
value
)
{
this
.
_cache
[
key
]
=
value
;
};
/**
* Null object cache implementation
*
* @class NoCache
*/
function
NoCache
()
{
}
/**
* NoOp
*
* @memberof NoCache
* @instance
*/
NoCache
.
prototype
.
get
=
function
()
{
};
/**
* NoOp
*
* @memberof NoCache
* @instance
*/
NoCache
.
prototype
.
set
=
function
()
{
};
module
.
exports
=
{
MemoryCache
,
NoCache
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 06:07 (4 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d6/56/2e1b891ee78f55abaa9e4758505b
Default Alt Text
cache.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment