datasource-cache.js revision 6608a5406cae6b74c06f0a501e189d1fc173dc21
150N/A * Extends DataSource with caching functionality. 150N/A * Adds cacheability to the YUI DataSource utility. 150N/A * @class DataSourceCache 150N/A * The namespace for the plugin. This will be the property on the host which 150N/A * references the plugin instance. * @value "DataSourceCache" ///////////////////////////////////////////////////////////////////////////// // DataSourceCache Attributes ///////////////////////////////////////////////////////////////////////////// * @description Internal init() handler. * First look for cached response, then send request to live data. * @method _beforeDefRequestFn * @param e {Event.Facade} Event Facade. * @param o {Object} Object with the following properties: * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd> * <dt>request (Object)</dt> <dd>The request.</dd> * <dt>callback (Object)</dt> <dd>The callback object.</dd> // Is response already in the Cache? return new Y.
Do.
Halt(
"DataSourceCache plugin halted _defRequestFn");
* Adds data to cache before returning data. * @method _beforeResponse * @param e {Event.Facade} Event Facade. * @param o {Object} Object with the following properties: * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd> * <dt>request (Object)</dt> <dd>The request.</dd> * <dt>callback (Object)</dt> <dd>The callback object.</dd> * <dt>data (Object)</dt> <dd>Raw data.</dd> * <dt>results (Object)</dt> <dd>Parsed results.</dd> * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd> // Add to Cache before returning