for one of the projects i'm working on, i'm going to need to display data that is going to be updated once a week... now, i want to save the overhead of retrieving the data from the database for each request by somehow cacheing the data.
what i was thinking of doing so far is:
use the ServletContext to store my data bean
have the controller(servlet or bean) attempt to retrieve the data bean, if the retreival is sucessful, check the date attribute of the bean against current date, to see if data needs to be updated...
-if bean is not available(for whatever reason.. server restart, etc.) or the data is out of date then create new data bean, and store it in the servlet context.
-if data bean is valid then do the display logic.
now i know this is pretty rough, i'm trying to apply, to a regular java bean, the read-only cache strategy that is meant to be used by entity beans where the server reloads the bean at certain intervals... let me know what u think..
Thanks in advance..