This is an old thread that I have been meaning to follow up. Sean suggested:

>> that one
>> 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:

    <r:number />
    <strong><r:title /></strong>
    <br />
    <r:phone_number />
    <br />
    <a href="<r:url />">Website</a>

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!

On Tue, Aug 5, 2008 at 12:37 PM, Mohit Sindhwani<> wrote:
> Sean Cribbs wrote:
>> Right.  The only caveat of disabling the cache is the potential for
>> lower performance.  However, my point in bringing that up is that one
>> should focus on the _why_ you need an uncached page in the first
>> place, and address that need first.  For example, with comments (see
>> the radiant-comments project on github from ntalbott and
>> artofmission), it may not be necessary to make the page uncached
>> because you can clear the cache after a comment is posted.
> Sean
> Thanks for the explanations.  I shall try to put these into the
> documentation this weekend.  I think the example from the radiant-comments
> extension will be very useful.  I shall look it up!
> Cheers,
> Mohit.
> 8/6/2008 | 12:37 AM.
> _______________________________________________
> Radiant mailing list
> Post:
> Search:
> Site:
Radiant mailing list

Reply via email to