All, Is there a way to keep a specific page from being cached by Radiant? Thanks, Wes
on 2010-10-13 04:17
on 2010-10-13 04:46
On Tue, Oct 12, 2010 at 10:16 PM, Wes Gamble <weyus@att.net> wrote: > All, > > Is there a way to keep a specific page from being cached by Radiant? > > Thanks, > Wes > You could make a custom page class and turn it off. class NoCachePage < Page def cache false end end You could also take a look at http://ext.radiantcms.org/extensions/123-page-options
on 2010-10-13 19:16
On 10/12/10 9:45 PM, Jim Gay wrote: > class NoCachePage< Page > def cache > false > end > end > > You could also take a look at > http://ext.radiantcms.org/extensions/123-page-options The page-options extension appears to no longer be compatible with Radiant (it was written at Radiant 0.7), per: def cache_setting @page = Page.find(self.id) case true when @page.cache_expire_minutes == 0 && @page.cache_expire_time == nil: "Default" when @page.cache_expire_minutes == -1: "No Caching" when @page.cache_expire_minutes == 1: "1 minute" when @page.cache_expire_minutes > 1: "#{@page.cache_expire_minutes} minutes" when @page.cache_expire_time != nil && @page.cache_expire_time.is_a?(Time) "Daily at #{@page.cache_expire_time.strftime("%H")}:#{@page.cache_expire_time.strftime("%M")}" else "Not set" end end "cache_expire_minutes" and "cache_expire_time" are no longer page attributes, and as far as I can tell, all of the caching is not being managed through HTTP response headers, is that correct? Wes
on 2010-10-13 23:48
On Wed, Oct 13, 2010 at 1:15 PM, Wes Gamble <weyus@att.net> wrote: >> You could make a custom page class and turn it off. > The page-options extension appears to no longer be compatible with Radiant > minutes" > managed through HTTP response headers, is that correct? > > Wes > Caching is handled via HTTP headers and RackCache, but the page_options extension adds fields to each page to control this. I've not used it, so perhaps others can jump in here.
on 2011-02-18 22:29
Jim Gay wrote in post #949713: > On Tue, Oct 12, 2010 at 10:16 PM, Wes Gamble <weyus@att.net> wrote: >> All, >> >> Is there a way to keep a specific page from being cached by Radiant? >> >> Thanks, >> Wes >> > > You could make a custom page class and turn it off. > > class NoCachePage < Page > def cache > false > end > end > If I made a custom page class to handle this, how would I assign particular pages to it? Wes
on 2011-02-19 01:43
Interesting - I tried this:
Page
class Page < ActiveRecord::Base
DENY_CACHING_PATHS = ['/']
def cache?
! DENY_CACHING_PATHS.include?(slug)
end
end
as an initializer but the expires header for '/' still came out at ~5
min.
Will need to dig deeper.
W
on 2011-02-21 22:16
I ended up defining a non-cacheable page like so:
class NonCacheablePage < Page
def cache?
false
end
end
and it works well.
Many thanks,
Wes
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.