Displaying 20 results from an estimated 500 matches similar to: "Making 'expire_fragment' available to a model?"
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 Jan 31
2
Fragment caching and pagination
I''m just getting my hands dirty with caching. The pages I want to cache have
some user specific data on them (for example "log out"). That sent me down
the route of fragment caching. One of the things I want to pagination is a
paginated list. My question is how is pagination and query strings handled
with fragment caching? Does each page get its own fragment and query string
2010 Sep 08
0
Re: Call expire_fragment from outside sweepers or controllers
xponrails wrote:
> Hi all.
>
> I need to expire cached fragments from outside sweepers or
> controllers: I have a rake task that calls a method inside a module in
> the /lib directory. This task will be called at a scheduled time by a
> crontab job.
>
> After method execution I would like to expire some cached fragments.
>
> I''ve just tried to import
2009 Feb 18
4
expire_fragment with memcached
Hello all,
We know that memcached or memcached-client doesn''t support regex... But
It seems it doesn''t support expire_fragment either :/
I''m trying to use expire_fragment with memcached as following :
expire_fragment(:controller => ''home'', :action => :list_posts)
But apparently it''s not supported by memcached :
RuntimeError (Not
2006 Jun 28
7
caching objects
Hi,
i just wanted to say my sorries in advance (sorrie/sorry/sorri)...i have
just started learning about the subject of caching, but unfortunately
haven''t effictively managed to implement what i had learned.
obviously it''s possible to cache a whole page, or action with the
caches_page :x or caches_action :y methods, but for some reason it
hasn''t really worked with
2005 Nov 04
1
expire_fragment outside of a controller
I am trying to figure out a way to call the
expire_fragment outside of a controller. I need to
expire some fragments on a hourly basis. I have a
Thread that every hour that will perform a task. The
expire_fragment is located in the module
ActionController::Caching::Fragments as an instance
method.
Do I need to mixin the model
ActionController::Caching::Fragments into my class?
Or is there
2006 Jul 12
3
Ajax, the Back button, and Sweepers
I''m working on an app that''s basically forms and that makes fairly heavy use of Ajax. As a result of the Ajax usage, if the visitor uses the back button they get the page as it was originally loaded, not as they left it. I''ve looked at the Sweeper documentation and can not tell for sure that it''ll do what I want, which is to force an unconditional reload from
2006 Jun 27
3
Easy question: Where do I put sweepers?
Trying to implement some sweepers to clean up my caching, but where do I
put them?
"ruby script/generate sweeeper" does nothing.
--
Posted via http://www.ruby-forum.com/.
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
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
2006 Nov 04
0
#expire_fragment in models...any clean solutions?
I''ve seen a couple of workarounds on the mailing list related to
expiring cached fragments inside of models, but nothing too clean.
Anybody have any suggestions for handling this at the model-level? I
have an application is updated outside of the Rails controllers, so I
can''t use a Sweeper.
The 2 methods I''ve seen:
a. Use a callback to generate an HTTP post on a
2006 Jan 03
5
Are cache sweepers used?
After drawing many virtual blank stares in the IRC channel and finding
zero results on the wiki for ''sweeper'' I''m left to wonder whether
these are actually officially supported, or are on their way toward
being deprecated. Is there a better way of expiring caches on model
saves and deletions?
Sincerely,
Tom Lieber
tom@alltom.com
http://AllTom.com/
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 Sep 28
4
Cannot expire cache from background process?
Hello,
I am trying to expire fragments (or at least trigger their expiration)
from a daemon that''s running in the background.
The daemon is updating all kinds of important lists every few minutes
from the background.
So I have to find some way to DO or TRIGGER the fragment caching from
this daemon.
Unfortunately just using the normal commands like:
expire_fragment :controller =>
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
2009 Dec 16
5
Caching comments: timestamps and subdomains
Hi,
I''m working on a website that has a very slow loading frontpage. I
wanted to start by caching certain elements that have high load. For
example, it loads the last 50 comments, along with the corresponding
usernames, avatars and more. So I cached that fragment and created a
sweeper that observes Comment and expires after every create or
destroy action.
However, I have two problems:
2005 Mar 10
6
Expiring Cache Fragments and fcgi
First let me say that Rails caching is very very cool. The traffic
(and responsiveness) I''ve saved by added 10 lines of ruby code would
be enourmous, if I actually had traffic... ;)
Sweepers as observers are great, btw. Since every page of my side is
dynamic, once I did some DB optimization I''m caching the content of
the index page which was taking the bulk of the time to load
2006 May 11
5
Engines 1.1.2
I''ve just pushed out a new bug-fix release for the Engines plugin.
Most notably, it''s now super careful (to the point of paranoia) about
ensuring that the right version of Rails is loaded, and should no
longer cause any issues where it ignores vendor/rails. Full CHANGELOG
is here:
http://dev.rails-engines.org/repository/file/engines/tags/rel_1.1.2/CHANGELOG
And you can find
2006 Jan 16
0
expire_fragment problem
Hello,
I am trying to invalidate a cached fragment.
My fragment looks like
<% cache (
:controller=>''users'',:action=>''additem_to_cart'',:action_suffix=>@user.id) %>
At this point,rails has created 2 cache files correctly and everything works
fine becuase I dont see rails making calls to the SQL db to get items from
DB.Instead it uses cache.
Now
2003 Sep 21
3
Samba PDC not creating roaming profiles
Hi All,
I have recently moved my PDC from a linux suse 7.0 box to a
Solaris 8 server. I have downloaded the samba 2.2.8a and
installed it without any errors.
I used my old smb.conf and made the neccasry changes to it, I
have pasted it below.
I don't receive any errors, it just ends up using a local profile and
doesn't bother to update it to the server.
I have looked at countless