1. Cached data (1 messages)

    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..

    Threaded Messages (1)

  2. Cached data[ Go to top ]

    Just a suggestion - look into using JSP caching tags. Weblogic 5.1(sp5+) has them, and if you use some other implementation, they are trivial to implement. One of the cool features is that they can be used to cache both output and input (calculations results) data.