I think this is a great idea, and I imagine it would be best implemented
as a Controller plugin. By hooking the routeStartup() and
routeShutdown(), can you then set the isDispatched flag to not dispatch.
Then at dispatchLoopShutdown(), the response object can be populated
with the cache contents (and perhaps headers as well when
Zend_Cache_Frontends_Page decides to implement them ;) )
-ralph
Kevin McArthur wrote:
I'm currently looking for a solution before putting together a proposal
for a currently non-existant class Zend_Controller_Router_Route_Immutable.
This would be a caching solution for routes that would allow you to
define a route as always having the same output for a given input and to
cache its response such that it can bypass the dispatch process
completely if it has been previously generated.
$router->addRoute('cached', new
Zend_Controller_Router_Route_Immutable('/route'));
This could be a significant performance increase, but I'm looking for an
elegant solution in terms of modifying the actual framework to support
it rather than creating a plugin or something else that occurs -during-
dispatch.
Thoughts?
Kevin