|
Posted by naixn on 12/02/06 18:59
Martien van Wanrooij wrote :
> [...]
Your problem is quite a common one. In fact, a request that is done on every
page may cause problem, and even more if not needed.
The idea to solve your "problem" would be to use cache. Instead of displaying
the HTML result, you put it in a file that you'll you include when needed.
If you're using a templating system, I'd suggest you to check wether it is able
to manage caching. Otherwise, you'll have to do your own system, that will
update the HTML cache file every time the data updates.
For example : if your page displays the nearest dates to the next performances,
you'll have to update the HTML cache file every time you add a performance
date.
But there's another solution : you can, on the page that displays the dates,
check the last modification time of the HTML cache file, and if it was
modified before one day ago, you update the cache ( by doing the SQL request ),
and then display the cache file ( since it has been updated... :D ).
That would give you : one SQL request a day. Not so many, eh? :)
--
Naixn
http://fma-fr.net
[Back to original message]
|