It'd be useful to have a JS cache system. This cache system would write an entire hierarchy to a .js file and then pretend this was a cache (while it's really just a copy of the *entire* hierarchy).

Postponed, because I don't need this myself and because this is a minor issue. Other, more important, aspects of HS need attention first.

CommentFileSizeAuthor
#12 hierarchical_select-284638-0.patch21.67 KBkurochig
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Version: 5.x-3.x-dev » 6.x-3.x-dev
Wim Leers’s picture

Status: Postponed » Closed (won't fix)
Wim Leers’s picture

crea’s picture

Status: Closed (won't fix) » Active

Hello Wim,
It's very useful feature when used togeter with small hierarchies. For example, with ~100 terms simple select can still be inconvenient but preloading of the whole hierarchy in HS would be fast and would eliminate all AJAX requests.
Any ideas how to implement this in a simplest fashion ?

Wim Leers’s picture

Exactly! :)

You'd have to use HS' caching API. It's not very well documented, but you can look at hierarchical_select_cache.js. It's not pretty, but it should work.

Basically, you should be able to copy paste that and change the HTML 5 Client-Side Database queries to downloading a piece of .js. This piece of .js is in fact not a file, but a menu callback. And so on. Not the most elegant approach, but it'll work within what we have right now.

I'll be looking forward to your feedback :)

vin247’s picture

Anyone had a go at implementing this method? Would like to see an example and get an idea on how to get it working since I'm having problem speeding up the response time when select parent terms to get their children loaded

thanks!

Wim Leers’s picture

Priority: Minor » Normal
Status: Active » Postponed
Issue tags: +Performance, +HS4

Tagging for HS4. Will be included in the HS4 roadmap: http://drupal.org/node/1052670.

vin247’s picture

Just in case anyone else is having performance issues try installing xcache, it's certainly given my installation of HS a performance boost.

Wim Leers’s picture

XCache/eAccelerator/any PHP opcode cache will make your entire site faster, not just HS. It can speed up PHP execution significantly.

klonos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

This will happen in the 7.x branch.

alexverb’s picture

Issue summary: View changes
Status: Postponed » Needs review

I want to reopen the discussion on caching for Hierarchical Select to avoid making database calls in particular for the entity count functionality which is really heavy on the database: #1068462-5: HS Taxonomy: "entity count" support — sponsorship needed

Clientside caching is nessecary for access control. What I had in mind was making use of the localStorage functionality to implement a clientside caching system. The only drawback of this is there is a limit on how much you can store there.

So I propose to make an optional library to compress the strings and extend the functionality as long as possible: http://pieroxy.net/blog/pages/lz-string/index.html

Hope to hear your thoughts on this. I don't really understand what Wim Leers was proposing in comment 5: #284638-5: New cache system: JS. Also open to explore that.

kurochig’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta8
FileSize
21.67 KB

Here is my attempt to port Hierarchical Select client side caching, using IndexedDB. I'm not using HS module for a long time, hope I didn't miss anything.

Summit’s picture

Hi, Anyone experimented with this please?
HS in the latest .dev is so slow!
greetings, Martijn

FireHawkX’s picture

I applied this patch (applied cleanly), cleared my cache twice, then ran cron to be sure...

I have no clue if it works or not... but in my particular case, it did NOT fix my issue... pages with Hierarchical Select Widget still takes between 1 and 2 minutes to load...

For reference, I have about 30k entries setup as term reference under 5 depth in my taxonomy...

I enabled devel statistics to check the time... everything loads in under 100ms while the 2 HS widget takes about 50,000 ms each...

So the patch DOES apply, but didnt fix loading speed for me... so not going to set to reviewed/tested even though it "might" work