jenkins-bot has submitted this change and it was merged.

Change subject: smw.Api.fetch() enable support for local caching (using 
localStorage)
......................................................................


smw.Api.fetch() enable support for local caching (using localStorage)

Using $.jStorage to ensure cross-browser key-value storage of result
objects (15 min set as default but it is customizable if needed) in order
to increase responsivness and reduce the amount of Ajax calls.

This is not to store resultObject for a large periode rather allow to
minimize Ajax requests for a timeframe where changes are less likely.

When ever the query string changes (conditions, limit etc) a new hash key
will ensure that a new cache object is generated during a normal ajax
request.

Response time when using localStoarge after smw.Api.parse() is about
10-30ms (depending on the amount of data being locally parsed).

## $.jStorage
$.jStorage is deployed with MW 1.20+ and since we need to support MW 1.19
we have to deploy the plug-in itself. (JSTORAGE_VERSION = "0.3.2" [0])

## md5 hash key generation
In order to ensure strings are comparable, a md5 hash key is generated.
The decision to use plug-in [1] is based on a higher performance
throughput[2] than the plug-in [3].

## Qunit
++ Add tests for caching/non-caching option

[0] https://raw.github.com/andris9/jStorage/master/jstorage.js
[1] https://github.com/blueimp/JavaScript-MD5
[2] http://jsperf.com/md5-hash-plugins
[3] http://www.semnanweb.com/jquery-plugin/md5.html

Change-Id: I294d4bb5ca035e1d4cda28777f34d25824b646c8
---
M resources/Resources.php
A resources/jquery/jquery.jstorage.js
A resources/jquery/jquery.md5.js
M resources/smw.api/ext.smw.api.js
M tests/qunit/smw.api/ext.smw.api.test.js
5 files changed, 1,533 insertions(+), 18 deletions(-)

Approvals:
  Mwjames: Looks good to me, approved
  jenkins-bot: Verified



-- 
To view, visit https://gerrit.wikimedia.org/r/48740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I294d4bb5ca035e1d4cda28777f34d25824b646c8
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames <jamesin.hongkon...@gmail.com>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Mwjames <jamesin.hongkon...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to