Displaying 20 results from an estimated 4000 matches similar to: "clearing/expiring the ''index'' action."
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)
2007 Oct 21
4
Making 'expire_fragment' available to a model?
I noticed a lot of repetition across different Sweeper models in my
app expiring the same fragments and so have been trying to move all
the expire_fragment calls into another model which the sweepers can
then use but it''s not working as I''d hoped..
I''ve created a CacheDestroyer model and want to be able to call
something to the effect of:
2006 Apr 10
3
can I expire a cached page using a regex?
I''m trying to expire all pages under my view action. These could
be /controller/view/1 or /controller/view/1/2
how can I expire all pages under /controller/view/? There must be a
way, but I''m stumped. Here''s my broken attempt. Thanks in advance for
any help,suggestions, or directions to a how to page.
expire_action(:controller =>
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)
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 Feb 21
2
caching and admin area
i have created some ''public'' controllers like so:
./script/generate controller example
and an ''admin'' controller like this:
./script/generate controller admin/example
now i want to have caching in the ''public'' controllers so i add
something like this:
caches_action :show, :whatever
but i want the ''admin'' controller to do
2009 Jul 09
0
Cache expiration with format not working as expected
Hi all,
In my OrdersController, I have two actions completed and incomplete
that respond_to HTML and CSV.
Im also action caching these actions
..
caches_action :completed, :incomplete
...
def completed
@orders = Order.completed
respond_to do |format|
format.html
format.csv {render :layout => false}
end
end
def incomplete
@orders = Order.incomplete
respond_to do
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
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 =>
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:
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
2008 Apr 11
0
expiring cache outside controller (e.g. in rake tasks)
Hello,
I need to expire cache outside controller, in my rake tasks. I want to
use standard methods expire_fragment,etc.. but I can''t manage to use
them outside controllers. I tried including
ActiveController::Caching::Actions but didn''t work.
Anyone has any solution? I''m losing my head how to do it... (besides
manually deleting files)
Thanks
Uros
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code:
@project_pages, @projects= paginate :project,
:per_page => 10,
:conditions => ["account_id = ?", account]
?!
If only I could pass the sub-collection
account = ...
@projects = account.project
to paginate, instead of letting it extract it with a find :all + sql
conditions
Alain.
--
Posted via
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''
2006 Mar 29
5
EdgeRails: "undefined method `weight'' for #<Hash:
Hi all,
I was playing with the sample project found on the Wiki at
http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails
, and everything was working fine, ... till I moved to EdgeRails :
undefined method `weight'' for #<Hash:0x22c7150>
(full error thread below)
Any idea?
Alain
2008 Jan 23
0
Action caching...
All,
I am running Merb 0.5.0. Is there a way to specify an expiration time on
an
action cache, besides physically calling expire_action ?
I have been looking at the code and I was not able to find support for
that
Something like
cache_action( :fred => 30*60, :blee => 60*60 )
would expire fred in 30 min and blee in 1 hour...
Any tips on how to achieve that ?
2005 Dec 18
2
[Bug?] in tests, @foo.bars_count <> @foo.bars.count
Example: if a ''foo'' has 3 ''bars'',
bars_count == "0" # ERROR
bars.count == 3 # OK
It looks like a bug to me.
Alain
--
Posted via http://www.ruby-forum.com/.
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
2005 Dec 21
7
Are there any disadvantages to using locomotive
Hi:
I had some issues and so switched to locomotive. I find it awesome. 1
click and its done.
My question - what disadvantages are there, if any? What do I lose by
using such a convenient solution.
speculation as well as facts are welcome but please define which you
are putting forwards.
Thanks in advance,
bruce
2005 Dec 16
4
Parent Child together in input form
Hi all,
I understand how rails is supposed to work when dealing with one entity
input form.
However, when I have a relation between two objects (composition):
Customer(1) --------> (1)Address
How can you create a inputform where both the properties of a Customer and
Address can be filled in?
Regards,
Harm de Laat
_______________________________________________
Rails mailing list