to describe it some more, if i have an image map of a region that when clicked, a query is performed to get more information about that region.
my client wants me to display an approximate number of search results while hovering over that region image map.
my problem is how do i cache? or get that number without heavily exhausting my server's memory resources?
btw im using php and mysql if that's a necessary info.
You could periodically execute the query and then store the results (e.g., in a different table).
The results would not be absolutely up-to-date, but would be a good approximation and would reduce the load on the server.