Displaying 20 results from an estimated 100000 matches similar to: "Conditional Action Caching?"
2006 Mar 29
2
Fragment Cache Wackiness
I can''t seem to get the fragment cache to use :file_store. I''d really
appreciate it if someone could point me in the right direction.
Rails 1.1 final, FreeBSD
Observe:
In environment.rb AND production.rb (for good measure, DRY be damned):
ActionController::Base.fragment_cache_store = :file_store,
"/www/apps/localfeeds/directory/tmp/fragmentcache/"
At the console
2012 Jan 25
0
Can't Get Caching to Work with Heroku and Memcache
I''m on Heroku and trying to implement caching in my Rails app, but I''m
running into some problems that I don''t understand. I thought it would be
easy after reading the Rails Guide and Heroku docs on caching strategies,
but apparently doing something wrong.
Issue 1: view of action doesn''t seem to expire Issue 2: when I use :layout
=> false, both my admin
2007 Feb 03
1
How can I bypass caching for some users
I have action caching setup for several actions of an application but I
want the caching to only run for my administrators and have all other
users see non-cached pages. Is there a way to do this? Perhaps
something like passing a block to caches_action or setting some sort of
flag in my authentication method? If this is not possible with action
or fragment caching does anyone know of a
2005 Mar 24
3
Caching computation in rails?
Caching computation in rails?
Simple example: factorial modulus a large number
input: integer x
output: factorial( x ) % 12345678901234567
I want it so that if it computes factorial of N once, it will not have
to compute for N again.
code:
class SiteController < ApplicationController
caches_action :factorial, :inv
def examine
@inv = @params[''inv'']
@outv =
2007 Jan 22
2
caches_action :index for site root gets propagated to lower levels (how to stop?)
Hello all,
I am running a blog system which has its "/" (home page) cached like
this:
class ApplicationController < ActionController::Base
before_filter :index_cache_expirer, :only => [:index]
caches_action :index
so the site''s top page is caches for 60 seconds in my case
(index_cache_expirer is a home-made function to expire)
on the site, there is also a
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
2006 May 31
1
Using caches_action ?
Hi
When I enable action caching in my controller with
caches_action :view_thread
only the first part of my layout template is rendered (up to the yield
statement), and the development.log shows
Processing ForumController#view_thread (for 127.0.0.1 at 2006-05-31
03:13:19) [GET]
Session ID: d6f7ef15f479250fd7e31e252d70f5ff
Parameters: {"action"=>"view_thread",
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
2006 Jun 30
0
Caching & Attachments
I''m noticing a different behavior between development and production
environments when I use caches_action along with send_data.
I have a method:
def image
@thePic = Picture.find(params[:id])
send_data(@thePic.image.data, :filename => @thePic.image.filename,
:type => @thePic.image.content_type, :disposition => "attachment")
end
Which works fine; it
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
Hi folks -
Seeing a weird problem and would love some help. It''s documented in
http://pastie.org/278310 to be more readable.
In short, I have a
caches_page "action", :if => {stuff}
but the :if is never being called - the action is just caching every
time. (If I put a debugger call in the :if block, it never stops.)
If I replace caches_page with caches_action, the if
2007 Mar 26
2
Calling a controller action from script/console or runner
Is there a way to call or invoke a controller method from script/console
or script/runner? The reason is that I''d like to pre-cache some of the
actions on my controller.
The pseudo code below is what I''d like to be able to do:
class MyController < ApplicationController
caches_action :test
def test
puts ''Hi there''
end
end
script/console:
2007 Mar 19
3
rSpec on Rails Integration Testing
I see that there is an integration testing example in the plugin
code. What is the thinking about integration specs?
Thanks,
Steve
2007 Mar 03
3
ignoring attempt to close td with tr ???
I got the most current rspec and installed as a plugin. Running rake
spec:controllers gives me this error:
ignoring attempt to close td with tr
I dumped response.body and everything looks fine. Is this a known
issue? Nothing in Google about it.
Thanks,
Steve
2006 Feb 13
3
caches_action does not go off the entire URL
I am trying to use caches_action and the agile book says that it is keyed
off the URL, however it does not seem to pick up the URL parameters.
http://localhost:3000/controller/action/id?foo=bar
and
http://localhost:3000/controller/action/id?foo=foobar
Returns the same page.
Anyone looked into how to add URL parameters to the cached key? Also,
where do those file get stored?
Thanks
Dave
2006 Aug 23
0
Caches_action/ before_filter problem .
Hello, I have a method called "check_permission" that is set to run as a
before_fitler and which checks if a user has the authorization to view a
page.
This page is displayed through the method "show" which is cached through
the tag "caches_action :show"
My problem is that once a user with authorization to a page accesses it,
then afterwards all users (with or
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 Jan 31
6
How to Affect Plugin Load Order
I''m using bundled_resource, login_engine, and a few other plugins. It
appears Rails considers plugins in alphabetic order. Turns out that
there is a particular order that will work and alphabetic ain''t it.
The login engine must be loaded first. Bundled resource then includes
''application_helper'' and the application helper includes LoginEngine. If
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read
about it at http://blog.caboo.se/articles/2006/06/13/a-better-
assert_difference and to some it should look familiar -- you know who
you are :), so I took a shot at one for rSpec on Rails.
class Object
def should_be_different(method = nil, difference = nil)
return self.should_not_eql(yield) if method.nil?
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
2008 Feb 15
2
HAML question - conditional multiple classes on a div
I am looking into HAML and am trying to convert one of my ERB templates to
see what I think of it. Everything was going pretty well until I got to the
following snippet:
<div class="<%= t.done ? "task done": "task" %>">
<p class="title"><%= h(t.description)%></p>
</div>
How would you do this in HAML? (I know how to