Log in

View Full Version : Cache a dynamicaly generated menu ( from dir structure)



SameerMirza
04-20-2009, 04:49 PM
Hi all,
I have created a tree menu that is dynamically loaded from the directory structure on my web server. Because it takes a while to load, I was wondering if there is any way to cache the menu so that the browser doesn't have to load it again and again.

My idea is to cache it twice a day maybe (to keep up to date as it is accessing the report). Does any one know a way of doing it?

Regards,

Sameer.

boogyman
04-20-2009, 08:46 PM
unless you've set the server to not do so, the browser by default will cache the page

vincentvu
05-16-2009, 11:10 PM
Maybe you can try using the PHP to create a Javascript file on-the-fly. Twice a day you will have new versions of that .js file. So when people go to your site on different pages, they will still loading that .js file, and it will be cached. Saving the loading time for the script if you have it in-lined.