Hi,
This is perhaps a shot in the dark, but on the OSCache lists / emails we
see a lot of people wanting to cache their MVC work - this includes
caching the view (jsp) AND the controller (action).
Using OSCache one can really only cache the JSP processing portion of
the request. It is possible to cache (via the APIs) the controller
action, but I think I have a better solution.
Is it possible to create a 'CachingAction'?
Here's my thinking (and in advance, no this doesn't work for all
situations!)...
- some actions are merely used not to 'do stuff' but to 'retreive stuff'
(take for example search results or filtering of some data set)
- those actions take in a defined set of parameters, and for
combinations of those produce a fixed set of results (ie
query=x&start=10)
- could we not then create a CachingAction that looks at timing,
parameters and the existing cached results before calling doExecute()?
(say if the time specified in getCachePeriod() - default 1 hour - has
not elapsed, and a request with identical parameters has already run,
just spit out the same result without calling doExecute())
I know this is useless for actions that 'do' something (bad terminology
;) - ie actions that alter the DB) but there are a few situations where
I think this would come in handy.
Thoughts? Am I smoking the caching pipe too much?
-mike
--
Mike Cannon-Brookes :: mi...@at...
Atlassian :: http://www.atlassian.com
Supporting YOUR J2EE World
|