This is an old thread that I have been meaning to follow up. Sean
should focus on the why you need an uncached page in the first
place, and address that need first
I wanted to provide an example of why I needed to have a page not
cached and see if there was a better way to implement this. Feel free
to chime in!
This is why I needed the page not to be cached:
I created a store directory extension which had structured data such
as store name, floor, location etc. Nothing special to this, basically
the same as the “link roll” example extension.
I created some custom tags to displays the store index. Again nothing
special here. However, the store index linked to a store’s detail
I created a route:
map.with_options(:controller => 'site') do |site|
site.connect 'store-directory/:name', :action => 'show_page',
:url => ‘/store-directory/store’
This captures URL’s like these:
This routed to a single store page which acted as my template. The
name (or slug) was used to look up the store in the database. I used
some tags in my store details pages which looked something like this:
The store tag found the store by name/slug.
Because I was using a single page to display the store details which
would change based on the name passed in the URL, the first store that
was shown would be cached and when visiting other store details, it
would display the cached store, rather than the proper details.
Making the store template page not cached, resolved this issue.
Did I go about this the right way, or is there a better method so I
can have all the store details cached as well? Any thoughts would be
much appreciated! Thanks!