Displaying 20 results from an estimated 30000 matches similar to: "Rails fragment caching bug?"
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
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 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 Dec 16
0
memcached vs regex fragment expiry
Hi,
I thought i''d give memcached a try. Installed it all, made the change
in environment.rb and it all seems ok. I can telnet to memcached
process and manually retrieve the data being cached.
However, when I try to expire a fragment using a regex, eg:
expire_fragment(%r{forums/recent/.*})
it throws an error:
undefined method `delete_if'' for #<MemCache:0x2289968>
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 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
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 Aug 10
1
Fragment cache creates folder for each URL.
I''ve got a site that uses fragment cache stored in tmp/cache.
When you access it as http://www.site.com it creates a folder
tmp/cache/www.site.com.
Likewise, when you access it http://site.com it creates af older
tmp/cache/site.com
I believe it does the same with sessions, though I store those in the
DB. How do I go about fixing this? Can i redirect using .htaccess or
Webmin?
--
2006 Aug 03
1
time based caching on rails pages.
Hello,
Quick question on caching based on time based expiration. Is this
something that rails supports? Is there a way to instruct rails to
refetch the new page after a time period or do we actually have to spawn
a background process and have it expire the pages.
Thanks,
Sam.
--
Posted via http://www.ruby-forum.com/.
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
2007 Mar 22
1
doable ? action caching if anonymous, fragment caching if logged in ?
Hi All,
I''d like to use different caching strategies based on the visitor status
- anonymous => action caching
- logged in => fragment caching
Is that doable? Where should I start?
TIA
Alain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2006 Aug 25
1
Time based fragment caching plugin
I''ve written a plugin to allow for time based fragment caching. It lets
you do things like:
<% cache ''fragment_name'', 10.minutes.from_now do %>
<p>something intensive which will be cached for 10 minutes</p>
<% end %>
Also, there''s a convenience method so that in your controllers you can do:
when_fragment_expired
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
2006 Aug 18
1
Fragment Caching
Hello.
I wouldn''t mind getting some feedback about the use of fragment
caching. I''ve got a series of relatively expensive database queries
with their respective partials cached and everything is working fine.
The problem is that do get this to work I''ve had to move the database
queries from the controller into the view layer so as to avoid them
being called if the
2008 Nov 13
1
Fragment caching strangely honors the options I pass to it
Hi,
In my view I have the following cache:
<%- cache(:controller => ''products'', :action => ''index'', :action_suffix
=> ''footer'') do -%>
...
<%- end -%>
And that''s the file generated:
tmp/cache/views/www.mysite.com/products.action_suffix=footer.cache
Why isn''t fragment caching picking up the :index
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 =>
2008 Oct 03
1
fragment caching with search box
I''m trying to setup some fragment caching which works fine for the index
but i''m not sure how to ignore the caching if they are searching the
index results.
my code in short:
ItemsController
def index
@items = Item.search(params[:search], params[:min_rank],
params[:max_rank], params[:classification_id], ...)
end
index.html.erb
<% cache (''items'',
2009 Jun 11
1
fragment caching file_store problems
Hello,
I''m having problems on both my production and development servers with
fragment caching.
Every time I try to cache something using <% cache do %>, I get the
following error:
Couldn''t create cache directory: views/0.0.0.0:3000/jobs/106/questions/
174 (wrong number of arguments (2 for 1))
but strangely, all of the directories apart from the last one are
created.
2007 Mar 09
0
Does Bdrd 2.x handle fragment caching still?
From the API I was unable to determine if the new architecture for
BackgrounDRB still handles fragment caching? If so, how can I use it?
I am upgrading to the new architecture from the old one and used this
functionality in the old code base.
I like the new architecture, thank you.
Cheers,
Matt
2007 Feb 16
0
all-but-fragment caching suggestion
Hi,
with fragment caching one can cache parts of a page. However, more often
than not what I would need is the exact opposite approach. I would like
to be able to use action cashing and have a mechanism for telling Rails
to exclude one or more areas from the cashing and fill them with dynamic
content instead. A good example would be a page where all content would
be perfectly cachable but one