Board Logo

cache problem
kikcontains - 3/27/2007 at 07:24 AM

hi,

we develop a menu (with tree menu pro) that contains about 900 items. With a HTTP spy, we see that whenever we opened a level it returns to make n requests of the graphs. Also whenever we put the mouse pointer above makes more requests. It makes requests to plusbottom.gif, minusbottom.gif, folder.gif, folderopen.gif, line.gif, page.gif.

How I can avoid this behavior? It does not cache the images? The configuration of cache of the Internet Explorer is a??whenever it visits the pagea??.


tigra - 3/28/2007 at 02:12 AM

In the script we do everything we can to make sure images are preloaded and cached. In the end it's up to the browser to decide to re-download the image. Look at the caching settings in your browser. Also there may be something in HTTP headers that suggests the browser that the images should be reloaded next time.


kikcontains - 3/28/2007 at 08:38 AM

the caching settings are "every time that visit the page" (the first choice)

i don't have any http headers to no-cache.

attached to this post are the html code of the page

this is the html code of tree_tpl.js
-------------
/*
Feel free to use your custom icons for the tree. Make sure they are all of the same size.
If you don't use some keys you can just remove them from this config
*/

var TREE_TPL = {

// general
'target':'framedoc', // name of the frame links will be opened in
// other possible values are:
// _blank, _parent, _search, _self and _top

// icons - root
'icon_48':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // root icon normal
'icon_52':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // root icon selected
'icon_56':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // root icon opened
'icon_60':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // root icon selected opened

// icons - node
'icon_16':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // node icon normal
'icon_20':'http://s0600-1/nl/js/treemenu/icons/man_folderopen.gif', // node icon selected
'icon_24':'http://s0600-1/nl/js/treemenu/icons/man_folderopen.gif', // node icon opened
'icon_28':'http://s0600-1/nl/js/treemenu/icons/man_folderopen.gif', // node icon selected opened

'icon_80':'http://s0600-1/nl/js/treemenu/icons/man_folder.gif', // mouseovered node icon normal

// icons - leaf
'icon_0':'http://s0600-1/nl/js/treemenu/icons/page.gif', // leaf icon normal
'icon_4':'http://s0600-1/nl/js/treemenu/icons/page.gif', // leaf icon selected

// icons - junctions
'icon_2':'http://s0600-1/nl/js/treemenu/icons/joinbottom.gif', // junction for leaf
'icon_3':'http://s0600-1/nl/js/treemenu/icons/join.gif', // junction for last leaf
'icon_18':'http://s0600-1/nl/js/treemenu/icons/plusbottom.gif', // junction for closed node
'icon_19':'http://s0600-1/nl/js/treemenu/icons/plus.gif', // junctioin for last closed node
'icon_26':'http://s0600-1/nl/js/treemenu/icons/minusbottom.gif',// junction for opened node
'icon_27':'http://s0600-1/nl/js/treemenu/icons/minus.gif', // junctioin for last opended node

// icons - misc
'icon_e':'http://s0600-1/nl/js/treemenu/icons/empty.gif', // empty image
'icon_l':'http://s0600-1/nl/js/treemenu/icons/line.gif', // vertical line

// styles - root
'style_48':'mout', // normal root caption style
'style_52':'mout', // selected root caption style
'style_56':'mout', // opened root caption style
'style_60':'mout', // selected opened root caption style
'style_112':'mover', // mouseovered normal root caption style
'style_116':'mover', // mouseovered selected root caption style
'style_120':'mover', // mouseovered opened root caption style
'style_124':'mover', // mouseovered selected opened root caption style

// styles - node
'style_16':'mout', // normal node caption style
'style_20':'mout', // selected node caption style
'style_24':'mout', // opened node caption style
'style_28':'mout', // selected opened node caption style
'style_80':'mover', // mouseovered normal node caption style
'style_84':'mover', // mouseovered selected node caption style
'style_88':'mover', // mouseovered opened node caption style
'style_92':'mover', // mouseovered selected opened node caption style

// styles - leaf
'style_0':'mout', // normal leaf caption style
'style_4':'mout', // selected leaf caption style
'style_64':'mover', // mouseovered normal leaf caption style
'style_68':'mover'// mouseovered selected leaf caption style

// make sure there is no comma after the last key-value pair
};
------------


tigra - 3/28/2007 at 02:22 PM

there is nothing unusual in your files. The files should be cached by the browser.


kikcontains - 3/28/2007 at 04:30 PM

nothing unusual?

why appears too many requests in the spy requests of the Internet to explorer? see the file attached to first post


tigra - 3/28/2007 at 04:56 PM

to make sure the files are actually requested see the access log of the server


kikcontains - 3/29/2007 at 11:34 AM

xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:14, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 15, 317, 741, 200, 0, GET, /nl/js/treemenu/tree.css, -,
xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:14, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 0, 316, 13670, 200, 0, GET, /nl/js/treemenu/tree.js, -,
xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:15, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 16, 320, 3735, 200, 0, GET, /nl/js/treemenu/tree_tpl.js, -,
xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:15, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 0, 333, 370, 200, 0, GET, /nl/js/treemenu/icons/man_folderopen.gif, -,

... skipped ...

xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:20, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 0, 410, 140, 304, 0, GET, /nl/js/treemenu/icons/line.gif, -,
xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:20, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 0, 410, 140, 304, 0, GET, /nl/js/treemenu/icons/join.gif, -,
xxx.xxx.xxx.xxx, -, 3/29/2007, 13:10:20, W3SVC1, S0600-1, xxx.xxx.xxx.xxx, 0, 410, 140, 304, 0, GET, /nl/js/treemenu/icons/page.gif, -,


tigra - 3/29/2007 at 02:42 PM

yep, it looks like the images are requested every time. Still the influence of the JavaScript on this aspect of the browser functionality is limited. We do what we can to insure the caching (by pre-requesting the images), the rest is for the browser to decide. I'd like to note that caching works in other systems.


kikcontains - 3/29/2007 at 02:49 PM

it's possible to put all the images, .js and .css in the local drive and change the location http://xxx.xxx.xxx.xxx to file:///c:local?


tigra - 3/29/2007 at 05:17 PM

sure, there are no hard coded links in the script, you can adjust them the way you want


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/