similar to: expire_page not working

Displaying 20 results from an estimated 300 matches similar to: "expire_page not working"

2007 Feb 14
4
cache sweeper not getting called
Hi, I''ve started to implement page caches but I''ve hit a brick wall getting a sweeper to clear the cache when needed. It seems that any models that I tell it to observe aren''t being observed properly. If I add the sweeper to a controller the initialize method runs, but no matter what I do the after_save/after_update callbacks aren''t running. Also if I try to
2008 Apr 01
1
"Undefined method merge" when using sweeper
Hi, I''m trying to use sweepers for the first time and got a problem - I get "undefined method `merge'' for "/signature/ f2d7c7c66450b169.html":String". The "/signature/f2d7c7c66450b169.html" part of the error message is the cached page. Here''s my sweeper: class FooSweeper < ActionController::Caching::Sweeper observe Foo def
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe one of you guys can help me out. I''ll show my sweeper and then my log to show that it "should" be working. class PragmaticSweeper < ActionController::Caching::Sweeper observe Comment def after_save(comment) expire_page(comment.post_id) end private def expire_page(post_id)
2006 Mar 09
0
Caching problem: expire_page not working
Hi all, I''m new to rails and I''ve run in to a rather insidious bug. In development (with caching turned on in development.rb), my app successfully caches action "index" in controller "view": class ViewController < ApplicationController caches_page :index def index # do the stuff that index does end end I''ve got a sweeper
2006 Jan 25
1
cache_sweeper causes undefined method error
I created a sweeper ItemSweeper and saved it in app/models/item_sweeper.rb. Then I put this in my item_controller.rb: cache_sweeper :item_sweeper, :only => [:create, :destroy, :update] But now when I call the view action, I get this error: ActionView::TemplateError (undefined method `title'' for nil:NilClass) on line #5 of app/views/item/view.rhtml: 5: <H1
2005 Apr 25
1
Problems when using sweepers with postbacks
I''m using a cache sweeper class [1] to take care of some pretty complex sweeping. However, there is a problem with the current implementation. Namely, the sweeper gets called only when an action named in cache_sweeper is called using GET. As many methods where sweeper would be useful are using postback to send the form to the same action, this causes the cache to get swept when
2006 Sep 15
2
Caching::Sweeper Access to Controller
Hello, I''m running Mongrel 0.3.13.3, cluster 0.2.0, and Rails 1.1.6 and I have a problem with a sweeper not having access to the controller instance. NoMethodError (undefined method `session'' for nil:NilClass): /app/models/audit_sweeper.rb:16:in `log'' /app/models/audit_sweeper.rb:9:in `after_update''
2008 Jan 26
0
"value must be enumerable" exception when using a sweeper?
Folks, I''m going slightly crazy here - I implemented a Sweeper in an older app and used nearly the same exact code in my new app, yet I keep getting this ''value must be enumerable'' exception. Even after I cut most of the code away, I still get the error. If anyone can help, I would be much obliged. Notes: I''m using Engines... wonder if that could cause a
2005 Jun 26
4
calling controller and caching from a sweeper class
[cross-posting to rails and typo lists] Hi, I''m tinkering with the code for typo, a rails-based blog engine. Typo has an XmlController with actions "rss" and "atom" which generate feed.xml files, and it uses a caches_page declaration to cache the files that get generated by those actions. It also has a Sweeper (Observer) class that expires those cached files when a
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi I''m working on a program which relies on heavy cache sweeper usage. I''ve just bumped onto an odd problem. When using render_component method in layouts or templates with cache sweeping turned on, Rails throws an exception with the following message: NoMethodError in TestController#index You have a nil object when you didn''t expect it! The error occured while
2006 Jan 27
0
Cache Sweepers and runner scripts that act on models?
I created a script that I call by ''./script/runner -e production UpdateItems.get_new_items()'', which basically calls the model Item: Item.create(attributes...) I''ve set up a cache sweeper which removes caches after each create/destroy/update on Item, and it works fine when accessing controllers via the web server, but apparently doesn''t work via runner.
2007 Sep 21
0
Plugin that will expire_page across multiple servers?
Hi all - I was wondering if there''s a plugin out there that will make expire_page work across multiple servers? That is, I''ve got two servers A and B behind a load balancer. If I cache a page eventually it will be cached on both servers. I''d like a way to expire that page and have it happen on both servers. Perhaps some integration with backgrounddrb that could
2006 May 21
0
expiring cache fragments using script/runner
I''ve just set up caching on my site and want to expire some of fragments on an hourly basis. I was going to use cron and script/runner to do this. For other fragments that I am expiring, I am using expire_fragment inside a sweeper class, something like: class QuestionSweeper < ActionController::Caching::Sweeper observe Question def after_validation_on_update(question)
2006 Apr 09
1
PageSweeper not working since upgrading to 1.1.1
Hi, I upgraded from 1.0 to 1.1.1, now my cache sweepers acts up. They worked perfectly before he upgrade, now I get strange errors. I have an empty controller, it looks like this: class PageElementsController < ApplicationController cache_sweeper :element_sweeper def element_container_show render :inline=>"" end end The sweeper looks like this: class
2008 Mar 06
3
cache_sweeper
Hi, Why is cache_sweeper not a documented method? I was pretty sure it used to be, but I could be wrong. I can''t seem to find any information on it anymore in the online docs. As a side note, looking at the code for cache_sweeper it appears to only work with the :only option, not :except (ignores it)... what''s the reason for this? Thanks, Andrew
2006 Jun 14
1
page caching with custom routes
hi , I''m having problems with expire_page with custom routes i''ll show some code blog_controller --------------- def clear_cache_rss_artikels expire_page url_for(:controller => "xml",:action => "rss_artikels") end this is called when a new article is posted or edited or destroyed xml_controller --------------- class XmlController <
2006 Apr 29
1
Caching foor starters
Hi there... I have some experience in building web applications but all of them have been intranet apps so I have never had to think about things like caching. Actually my experience with caching has more been in the area of removing it since it just gets in the way for a intranet app with 10-100 users. But now I am writing a site which might stand or fall by the quality of it''s
2007 Oct 24
0
Sweeper for few models
For example - i have a sweeper for one model(in this case About). class AboutSweeper < ActionController::Caching::Sweeper observe About def after_create(data) expire_about(data) end def after_save(data) expire_about(data) end def after_destroy(data) expire_about(data) end def expire_about(data) FileUtils.rm_rf
2009 Aug 04
0
Authlogic::How to access current user from within a cache sweeper?
So I''m trying to follow along in Chad Fowler''s Rails Recipes (recipe #59, Keeping track of who did what) and I simply want to access the current user from within my cache sweeper. Normally you just reference @current_user but that doesn''t seem to be the case here. In Chad''s example, he calls controller.session[:user]. What''s the Authlogic equivalent?
2010 Mar 28
1
keeping track of who did what
hello everybody. i need to log "who did what" on some models. i was reading recipe 59 of rails recipes and i created something like that: class LogSweeper < ActionController::Caching::Sweeper observe :model1, :model2, :model3, :model4, :model5, ... after_save(model) save_log(model, "save") end after_destroy(model) save_log(model, "destroy) end