Displaying 16 results from an estimated 16 matches for "expire_pag".
Did you mean:
expire_page
2007 Sep 10
2
expire_page not working
...per code is as follows:
class PersonSweeper < ActionController::Caching::Sweeper
observe Person
def after_update(person)
expire_staff_page
end
def after_destroy(person)
expire_staff_page
end
def expire_staff_page
$stderr.puts "@@@@@ Expiring staff page"
expire_page( :controller => ''welcome'', :action => ''staff'' )
$stderr.puts "@@@@@ Staff Page Expired"
end
end
In my administrative controller, I have
class Admin::PeopleController < Admin::AdminBaseController
cache_sweeper :person_sweeper
and fi...
2008 Apr 01
1
"Undefined method merge" when using sweeper
...6450b169.html"
part of the error message is the cached page.
Here''s my sweeper:
class FooSweeper < ActionController::Caching::Sweeper
observe Foo
def after_save(foo)
expire_cache(foo)
end
def after_destroy(foo)
expire_cache(foo)
end
def expire_cache(foo)
expire_page signature_path(:opaque_id => foo.opaque_id) # line 13
expire_page signature_image_path(:opaque_id => foo.opaque_id)
end
end
The signature_path(:opaque_id => string) generates "/signature/
string.html" route, so this part works correctly.
Here''s stack trace:
......
2006 Mar 09
0
Caching problem: expire_page not working
...sweeper running in a different controller ("admin") which
expires view::index when changes are made to the underlying data. The
following line of codes in the sweeper don''t seem to work:
def expire_view(model)
model.logger.info("Expiring the cached index")
expire_page(:controller => "view", :action => "index")
end
Rather, I should say that "Expiring the cached index" is being logged
properly, but the page isn''t being expired. Am I missing something?
Thanks!
Brent
--
Posted via http://www.ruby-forum.com/.
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 th...
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_controlle...
2006 Apr 08
2
trouble expiring cached pages
...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)
logger.error("I made it to the caching method in the SWEEPER!!!!!!")
expire_action(:controller => ''pragmatic'',
:action => ''view'',
:id...
2007 Feb 14
4
cache sweeper not getting called
...lear 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 call "expire_page", I get a method missing error. It seems like the
class isn''t actually extending the Sweeper at all, is there something
I''m missing??
Here''s the sweeper code:
class PublishSweeper < ActionController::Caching::Sweeper
observe Program
def initialize
pu...
2006 May 21
0
expiring cache fragments using script/runner
...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)
expire_page :controller => ''xml'', :action => ''question'', :id =>
question.id
expire_all_recently_added
end
........
def expire_all_recently_added
expire_fragment :controller => ''landing'', :action => ''last_added'',...
2006 Mar 22
0
page caching
I''m trying to use the following methods (extract):
expire_page :controller => "site", :action => "funding"
cache_page :controller => "site", :action => "welcome"
to rebuild my entire site cache from an admin page, but I can''t seem to get the cache_page function to work. looking at the docs there s...
2006 Mar 27
0
render_to_string troubles
...page'' => "production.html" } }
] do
rebuild_page(options)
end
with the following in the application.rb controller:
# handle all regeneration of pages - available to all controllers
def rebuild_page(options, path = nil)
# get rid of the existing one
expire_page(options)
# pull the page in as a string
# set page parameters first:
if options.has_key?(:params)
options[:params].each_pair {
|key, value|
@params[key] = value
}
end
page = render_to_string(options)
# write the rendered content to the right pl...
2005 Dec 02
1
cache problem
Hi all
I try to cache page
...
caches_pag :test
...
I want expire cache now.
so i turn off environment cache switch
and comments above code
but, doesn''t work
what''s going on?
all regards
--
Posted via http://www.ruby-forum.com/.
2007 Nov 21
0
Expiring page caches with regexp?
...hing, I''d just use regexp, but that doesn''t
seem to work in page caching (at least the same way it does with
fragments).
I tried using "system "rm -rf #{RAILS_ROOT}/public/products/
#{category.url_slug}" from within the CategorySweeper which I was
trying to get the expire_page method to work in but it didn''t work
either (I didn''t really dig far into why this one wasn''t working..
should it?)
Thanks in advance for any help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google G...
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
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 Apr 11
11
I can''t get rails to see my plugin. How can I this?
...;t add any new
functionalit...yet. I wanted to make sure I could get the plugin seen
by rails before I did any real coding. Thanks in advance for any
assistance.
module ActionController::Caching::Pages::ClassMethods
# Expires the page that was cached with the +path+ as a key. Example:
# expire_page "/lists/show"
def expire_each_page(path)
return unless perform_caching
benchmaddrk "EXPIRED ALL PAGES: #{page_cache_file(path)}" do
File.delete(page_cache_path(path)) if
File.exists?(page_cache_path(path))
Dir.foreach(page_cache_path(path)) {|x| benchmark (&q...
2012 May 11
14
What is the point of using :format in routes?
Today I had a strange behavior that made me suspect of jQuery at first,
but then it happened that I''ve faced two gotchas, one from CoffeeScript
and one from Rails itself.
I have something like this:
routes.rb
post ''/fields/:id.:format'' => ''fields#show'', as: :field,
constraints: {id: /\d+/}
post ''/fields/remove/:id''