Displaying 20 results from an estimated 120 matches similar to: "page caching with custom routes"
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
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
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 Sep 10
2
expire_page not working
I''ve enabled page caching on a site I''m currently constructing. The
sweeper is called upon any changes made to the model, as expected.
The sweeper 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
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
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/.
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
2006 Mar 09
0
Caching problem: expire_page not working
Hi all,
I''m new to rails and I''ve run in to a rather insidious bug. In
development (with caching turned on in development.rb), my app
successfully caches action "index" in controller "view":
class ViewController < ApplicationController
caches_page :index
def index
# do the stuff that index does
end
end
I''ve got a sweeper
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 that could
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 Apr 11
11
I can''t get rails to see my plugin. How can I this?
I''m trying to produce a plugin to help me with my page caching woes. I
can''t seem to get rails to see my method within the plugin. This is my
first attempt at a plugin so I''m sure I''m missing something. I''ve
created a directory /vendor/lib/plugins/broom_stick/. I then created an
init.rb file with:
require ''broom_stick''
I then
2008 Jan 14
1
Problems with forms
hello all
i''m a newbie on mechanize, but already had some success.
But now i''m in a real problem :
The following HTML-Code is not parsed corect, not all form element are
found. I''can''t change the server-code.
How to fix ?
HTML-Site
------X-----------------------------------------------------------------------X-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD
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)
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 seem to be 2 versions of
2006 Mar 27
0
render_to_string troubles
Hi,
I''m trying to build a simple mechanism for pre-caching a bunch of files by iterating over a hash of options from within a controller:
#site.controller:
for options in [
{ :controller => "site", :action => "welcome" },
{ :controller => "site", :action => "about" },
{ :controller => "site", :action
2007 Nov 21
0
Expiring page caches with regexp?
Is there a way to expire page caches using regular expressions like
you can with fragment caches?
I''m writing an app which has a catalogue style product listing but not
full on e-commerce. It''s pretty simple; with just categories and
products within them. A url for a product called "Band Saws" within
the category "Heavy duty saws" would look like
2006 Mar 01
1
break in a each function
i have a method , and i only want the first 10 feeds to be put in the
database , why doesn''t this control structure works , when the counter
is 10 it has to jump out the iteration
greetz Klaas
def get_feed2(rssfile)
# Open the RSS file
rssfeed = open(rssfile.url)
# Use the built-in REXML module
# Read the entire RSS file into memory
rssdoc =
2012 Jun 27
1
Make a reference?
How can I make a reference i this case? I want to make a reference to
'Artikel XXX'
For example
In The Artikel 'XXXX' there is two tables.
..
Litterature
Artikel XXX
--
View this message in context: http://r.789695.n4.nabble.com/Make-a-reference-tp4634611.html
Sent from the R help mailing list archive at Nabble.com.
2001 Oct 04
4
wine wount do anything
Yello
I use (or try to use :) wine 20010824 (installed from MDK rpm).
If I try to run a app i get:
#wine notepad.exe
Warning: could not find wine config [Drive x]
entry for current working directory /home/enrique/.wine; starting in windows directory.
Loading required GL library /usr/X11R6/lib/libGL.so.1.2
And nothing more happens.
My system conf:
Linux Mandrake 8.0, kernel 2.4.8-24mdk, XFree
2006 Mar 30
1
Globalize DB translate not working in Rails 1.1.0
It seems there have been some changes to ActiveRecord between Rails
1.1.0 RC and 1.10 Final that cause Globalize to fail; 1.10 RC was
working fine. When retrieving records from the DB only the base language
version is fetched, even when the locale has been set differently. The
SQL in the log confirms that Globalize is ignored and a regular find()
is performed.