How to get Combo Cache to work

Hi,



I’m struggling with combos cache feature in filtering mode.

Even though I have caching feature set to true combo still fetches data each time from server instead of cache.

var combo=new dhtmlXCombo(“combo”,“combo”,“400”);

combo.enableFilteringMode(true,"/php/combo.php",true,true);



Are there any special requirements eg. in response headers to get caching work properly?



still fetches data each time from server instead of cache
Does it fetch data for the same text in combo?
The combo will request new data if you are typing different text in combo, but must not reload the suggestion list for the text which was already loaded.

Hi,

That is the case. When typing same text again into combo request is sent to the server instead of fetching data from cache.

Example:
I type into combo ‘example’. Seven requests are sent to the server, one for each keystroke, that is fine and that’s how it is supposed to work
But when I erase letters one by one with backspace, new request is sent even though in this case data should be fetched from cache in my opinion.
Same problem if I clear the combo and start typing ‘example’ again, each keystroke submits requests, again data should be fetched from cache in my opinion.

I am using FF 3.5 with Firebug extension to be able to see sent requests and received responses and in your example caching seems to be working exactly how I think it should work.
(dhtmlx.com/docs/products/dhtmlxC … ig_db.html)

Any suggestions what could be wrong in my case?

Hi again,

I got cache working. I used command
combo.setFilteringParam("maxopts","20");
for setting dynamically how many entries should be included in list.
When I transfered setting after the URL (syntax ?maxopts=20) Cache started working nicely.

But another problem/question occurred. I'll try to explain this via an example.

I am searching for organization that has short name and long name in database.
- I want to search from both fields with combos mask, no problem here.
- I concatenate both values into my XML so that it looks something like below. No problem here
shortname |fullname
- Problem is that when the results are fetched again from cache and search matched only with fullname option doesn't show up

Example. my search mask is 'G'

First time , when results come from server, results are as follows
<?xml version="1.0" ?>

216 | GASTRO
GLAXO WELLCOME | GLAXO WELLCOME
GOS HOSPITAL | GREAT ORMOND STREET HOSPITAL</option>


Now when I give some other search mask and then again 'G', first option is omitted --> only options that start with search mask are displayed

Is this a feature or a bug? And is there a workaround for this? If not I probably can't use the caching feature.

Problem with setFilteringParam confirmed and fixed , fix will be included in next build

>>Is this a feature or a bug? And is there a workaround for this?
When data not loaded from server , combo uses client side filtering which doesn’t know anything about server side rules.
It is more a bug than feature - updated js file is attached to the post, it must not use client side filtering when server side mode is used.

dhtmlxcombo.zip (15.9 KB)

Hi again,

Your fix seems to be working the way I was hoping for, thank you for that.