Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#12 | hierarchical_select-284638-0.patch | 21.67 KB | kurochig |
Comments
Comment #1
Wim LeersComment #2
Wim LeersComment #3
Wim LeersAlso see #370505: Performance: revamp HS' cache system.
Comment #4
crea CreditAttribution: crea commentedHello 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 ?
Comment #5
Wim LeersExactly! :)
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 :)
Comment #6
vin247 CreditAttribution: vin247 commentedAnyone 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!
Comment #7
Wim LeersTagging for HS4. Will be included in the HS4 roadmap: http://drupal.org/node/1052670.
Comment #8
vin247 CreditAttribution: vin247 commentedJust in case anyone else is having performance issues try installing xcache, it's certainly given my installation of HS a performance boost.
Comment #9
Wim LeersXCache/eAccelerator/any PHP opcode cache will make your entire site faster, not just HS. It can speed up PHP execution significantly.
Comment #10
klonosThis will happen in the 7.x branch.
Comment #11
alexverb CreditAttribution: alexverb as a volunteer commentedI 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.
Comment #12
kurochig CreditAttribution: kurochig commentedHere 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.
Comment #13
Summit CreditAttribution: Summit commentedHi, Anyone experimented with this please?
HS in the latest .dev is so slow!
greetings, Martijn
Comment #14
FireHawkX CreditAttribution: FireHawkX commentedI 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