diff options
author | mistic100 <mistic@piwigo.org> | 2014-05-24 14:18:04 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-05-24 14:18:04 +0000 |
commit | fea2a4efd1ad085def7cf84cc444325d0815b62e (patch) | |
tree | 892dcb971d34efd7cbff6c31375448a09dfbe73b /admin/themes/default/template/batch_manager_unit.tpl | |
parent | 59f418f7986594895a2352e8895250069cff336a (diff) |
feature 3077 : improve cache invalidation
- add "lastmodified" automatic field for categories, groups, users, tags and images tables
- provide a "server key" to the client cache manager
git-svn-id: http://piwigo.org/svn/trunk@28532 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/template/batch_manager_unit.tpl')
-rw-r--r-- | admin/themes/default/template/batch_manager_unit.tpl | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl index d0d06e11d..6d5a90ddd 100644 --- a/admin/themes/default/template/batch_manager_unit.tpl +++ b/admin/themes/default/template/batch_manager_unit.tpl @@ -10,16 +10,22 @@ {footer_script} (function(){ {* <!-- TAGS --> *} -var tagsCache = new LocalStorageCache('tagsAdminList', 5*60, function(callback) { - jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) { - var tags = data.result.tags; - - for (var i=0, l=tags.length; i<l; i++) { - tags[i].id = '~~' + tags[i].id + '~~'; - } - - callback(tags); - }); +var tagsCache = new LocalStorageCache({ + key: 'tagsAdminList', + serverKey: '{$CACHE_KEYS.tags}', + serverId: '{$CACHE_KEYS._hash}', + + loader: function(callback) { + jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) { + var tags = data.result.tags; + + for (var i=0, l=tags.length; i<l; i++) { + tags[i].id = '~~' + tags[i].id + '~~'; + } + + callback(tags); + }); + } }); jQuery('[data-selectize=tags]').selectize({ @@ -27,14 +33,7 @@ jQuery('[data-selectize=tags]').selectize({ labelField: 'name', searchField: ['name'], plugins: ['remove_button'], - create: function(input, callback) { - tagsCache.clear(); - - callback({ - id: input, - name: input - }); - } + create: true }); tagsCache.get(function(tags) { |