http://www.whatwg.org/specs/web-apps/current-work/multipage/section-sql....

This would essentially be:
- storing the entire tree client-side, but lazy-loaded (i.e. a branch is only stored whenever it is requested)
- when using the dropbox, requests to the server will still have to be made
- the tricky part: how to know when to invalidate the client-side tree? I.e. when is the three changed? A "change" can be a real change/addition, or a change in permissions (access to more/less/different items of the tree.

Will be for HS 3 or later.

Safari 3.1 (released today) already supports this, Firefox 3 (final not yet released) also supports this.

Comments

Wim Leers’s picture

Title: Make queries obsolete through HTML 5's client side storage » Reduce the number of queries to the server through HTML 5's client-side database storage
Version: 5.x-2.x-dev » 5.x-3.x-dev
Assigned: Unassigned » Wim Leers
Status: Postponed » Fixed

I went ahead and implemented this.

In the process, I cleaned up hierarchical_select.js significantly: several things were actually not yet queued properly, but because they typically take so little time to execute, this was not noticeable.

Notes:
- In hierarchical_select.js, you will only find 8 references to the cache system (Drupal.HierarchicalSelect.cache). All code exists in hierarchical_select_cache.js.
- The cache system is pluggable (i.e. you can override Drupal.HierarchicalSelect.cache). So somebody could write one that uses Google Gears and only loads that one if Google Gears is present.
- The speedup is significant. You can even feel the difference on localhost.
- There's no advanced technique present for cache invalidation. Currently, it will just reset the cache if it's older than 24 hours.

What can still be done better:
- documentation, but it's all relatively obvious
- more advanced cache invalidation technique, preferably using a scheme like:
* invalidate the entire cache of a hierarchy if changes are made on the vocabulary settings page
* when a term is changed, invalidate the tree below it
* when a term is added, invalidate the tree above it

I will make an issue for the latter, but it will obviously be postponed as it's a *very* minor task. It'll only be useful in very specific use cases.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.