I recently came onto a project with a large code base. I'm attempting
to speed it up a bit by page caching a controller action that does
most of the hard work. This "Browse#index" action handles the home
page in addition to browsing various content types :
BrowseController#index <= <site>/
BrowseController#index <= <site>/browse/atricle-category-name
BrowseController#index <= <site>/browse/product-review/cat-name
BrowseController#index <= <site>/browse//etc
The routes for this are as follows:
map.default_route '', :controller => "browse"
map.connect "browse/*url_components", :controller => "browse",
:action => "index"
I added caching like so:
This results in caching '/' with no url_components, nothing else is cached.
I believe I know *why* this doesn't work (the route doesn't play nice
with url_for), but not an easy work around.
While I'm looking at refactoring this code into several controllers, I
do not know the code base well enough to do that quickly and we're
trying for the moment to meet a deadline. Any ideas?