Displaying 20 results from an estimated 32 matches for "caches_pag".
Did you mean:
caches_page
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 evaluates
correctly.
There are before_filters in the controller, but...
2005 Apr 27
3
caches_page questions
I''m attempting to use caches_page to speed up the loading of certain
pages on my site, and have run into a couple questions:
1) The site has ''states'' (as in U.S. states), so I have a State model
and a States controller. Going to http://sitename/states/ routes you to
the States controller, ''index'...
2005 Mar 16
6
caches_page problem
I''m currently caches_page the show method in my Image controller. The
show method looks at @params[''id''] to determine what output should be
generated.
The first time I access the method, say with
http://localhost/public/image/show/1.jpg, the appropriate directories
get created in /public (i.e. public/im...
2006 Aug 19
1
caches_page does not follow url path
I am using lighttpd. I have a controller (headlines) with a caches_page
:index. When invoked via http://0.0.0.0:3000/headlines/ I find a
index.html cached in the public folder. The server did not create a
headlines folder and place the cached index page within the controller
directory as expected. Is there a configuration detail I need to change?
2006 Aug 22
1
Why the caches_page can not work?
Hi,I want the page to be cached and be accessed by all users.And in my
controller:
class MyController < ApplicationController
caches_page :show
def show
render :layout => false
end
end
When I use link_to_remote to use My/show to update some div, i can not
see the template has been cached. However,If I use
<%= render_component :controller => ''My'', :action => ''show''%>
in...
2006 Jul 20
5
Apache 2.2, Mongrel and #caches_page
Hi !
I''m no expect when it comes time to configure Apache. I just enabled
page caching in my Rails app, and am now looking at making Apache
serve the cached files instead of calling into Rails.
I know Mongrel is able to serve cached files if it finds them, but I''d
like Apache to do it.
Looking at .htaccess, there is this section:
RewriteEngine On
RewriteRule ^$ index.html
2005 Mar 10
6
images from database + caching
Is the information in
http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles on caching
images still the best way on how to cache images that are served from
the database?
I haven''t added time information to my image table yet, and the images
are sent after every single page view (even if it''s been downloaded
already).
Joe
2006 Feb 04
4
Page caching feeds and cache file extensions
I have a feeds controller which generates RSS and Atom pages. I put
''caches_page :show'' in it. The problem is that the pages are saved with
an html extension. As a result, browsers display the cached feeds as
HTML rather than XML, and feed validators complain.
There''s an option to set ''Base.page_cache_extension'' globally, but I
don'&...
2006 Feb 07
1
Page caching when name contains a dot (period)
Hi Everyone,
Just thought I''d post some details of an interesting little quirk I''ve found
with page caching.
For a site I''ve just built for a small music festival, there are a number of
artist profiles. I''m storing the artists in my database, but using
caches_page to speed things up when displaying the details to the public.
I''ve also made it so that instead of the numerical ID appearing in the URL, it
uses the artist''s name instead. So if someone called "Bob Smith" was
playing, the URL would be: /artists/Bob+Smith
Now, with...
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 blog post is created or modified:
http://typo.leetsoft.com/trac/file/trunk/app/controllers/xml_controller.rb
http://typo.leetsoft.com/trac/file/trunk...
2006 Jun 14
1
page caching with custom routes
...---------------
def clear_cache_rss_artikels
expire_page url_for(:controller => "xml",:action => "rss_artikels")
end
this is called when a new article is posted or edited or destroyed
xml_controller
---------------
class XmlController < ApplicationController
caches_page :rss_artikels
def rss_artikels
@articles = Article.find(:all)
end
end
routes.rb
----------
map.rss "rss/blog/artikels",:controller => "xml",:action =>
"rss_artikels"
when the rss feed is called , rails make a file in the public directory
rss/blog/ar...
2006 Mar 22
0
page caching
...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 cache_page, one controlled by an options list the other one by a path. Both of these methods expect a content parameter, but I want it to cache as it would after caches_page. The options above are the same parameters passed through from the routes file that get successfully cached using the caches_page option.
Is it possible to use cache_page like this? or am I jumping the gun, or just doing it wrong...
dorian
--
I do things for love or money
2005 Dec 18
0
Caching question
...performance increase but
rails will never create home.html on it''s own. What am I missing?
Here is my home_controller.rb file. Initially it just had "def index" but I
added "def home" while trying various solution.
class HomeController < ApplicationController
caches_page :index
caches_page :home
layout "ui"
def index
@siteoption = Siteoption.GetSiteOptionHash("Home")
@header_image = @siteoption["header_image"]
@header_text = @siteoption["header_text"]
@blogentry_pages, @blogentries = paginate :blogent...
2006 Oct 12
2
HowTo autogenerate a cahced page that was deleted
Hi
I am using "caches_page :index" to cache a page.
I delete this file via a cron tab command every 1 hour.
However, right after the file is deleted the very next user experiences
a huge delay because the page is being generated.
Is there anyway to autogenerate the file before the very next user
requests the page? A...
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 May 17
2
Caching doesn''t work at all...
Installed RoR under lighttpd and noticed that caching some actions
didn''t accelerate page serving. The following little example of
class TestscriptController < ApplicationController
caches_page :index
def index
@string = Time.now.to_s
end
end
and
<html>
<head>
<title>Test</title>
</head>
<body>
<p>Test</p>
<p><%= controller.action_name %></p>
<p><%= @string %></p>
</body>
</html>
does...
2006 Apr 08
4
rails won''t cache my action
I''ve decided to dive into page caching for my rails app. I''m doing my
testing with webbrick and it refuses to display the cached page for a
particular action. I''ve modified my paginator helper to put the page
parameter in the url so that the paginated page can be used with
caching. This works perfectly when the page parameter is in the url (ie
browse/2006/2 or
2006 Jan 10
6
Can we cache user home pages?
Hi Railers,
I am trying to create a simple application like a guest book which has users
and uses sessions to keep track of
which users are logged on. The user''s page is constructed after doing some
SQL queries and the user clicks on another link and hits the back button I
dont want to regenerate the whole page (which is what happens now) .So I
want to use some kind of caching mechanism.
2006 Jul 22
0
SOAP and caching
Hi,
Is it possible to cache page/action within AWS?
The method caches_page doesn''t seem to work, nothing is being cached.
Thanks.
2006 Apr 11
0
Page cache and query string
.../www.site.com/foo/bar/query/a=b. Then in config/routes.rb there
is:
map.connect(''foo/bar/query/:query_string'',
:controller => ''foo'',
:action => ''bar'')
In foo_controller.rb:
class FooController < ApplicationController
caches_page :bar
before_filter :merge_query_string
def bar
render :text => "You asked for #{params.inspect}"
end
private
def merge_query_string
params[:query_string] or return
params.
update(CGIMethods.parse_query_parameters(params[:query_string])...