Permalink
Browse files

Fixed width font changes

  • Loading branch information...
1 parent e95f541 commit 5df4a6779715859b3a0626b52ddb2e0874f78547 @aditya aditya committed Nov 23, 2008
Showing with 17 additions and 17 deletions.
  1. +17 −17 railties/doc/guides/source/caching_with_rails.txt
@@ -10,8 +10,8 @@ need to return to those hungry web clients in the shortest time possible.
This is an introduction to the three types of caching techniques that Rails
provides by default without the use of any third party plugins.
-To get started make sure config.action_controller.perform_caching is set
-to true for your environment. This flag is normally set in the
+To get started make sure `config.action_controller.perform_caching` is set
+to `true` for your environment. This flag is normally set in the
corresponding config/environments/*.rb and caching is disabled by default
there for development and test, and enabled for production.
@@ -45,21 +45,21 @@ end
-----------------------------------------------------
The first time anyone requests products/index, Rails will generate a file
-called index.html and the webserver will then look for that file before it
+called `index.html` and the webserver will then look for that file before it
passes the next request for products/index to your Rails application.
By default, the page cache directory is set to Rails.public_path (which is
-usually set to RAILS_ROOT + "/public") and this can be configured by
-changing the configuration setting ActionController::Base.page_cache_directory. Changing the
-default from /public helps avoid naming conflicts, since you may want to
-put other static html in /public, but changing this will require web
-server reconfiguration to let the web server know where to serve the
-cached files from.
-
-The Page Caching mechanism will automatically add a .html exxtension to
+usually set to `RAILS_ROOT + "/public"`) and this can be configured by
+changing the configuration setting `config.action_controller.page_cache_directory`.
+Changing the default from /public helps avoid naming conflicts, since you may
+want to put other static html in /public, but changing this will require web
+server reconfiguration to let the web server know where to serve the cached
+files from.
+
+The Page Caching mechanism will automatically add a `.html` exxtension to
requests for pages that do not have an extension to make it easy for the
webserver to find those pages and this can be configured by changing the
-configuration setting ActionController::Base.page_cache_extension.
+configuration setting `config.action_controller.page_cache_extension`.
In order to expire this page when a new product is added we could extend our
example controler like this:
@@ -119,8 +119,8 @@ class ProductsController < ActionController
end
-----------------------------------------------------
-And you can also use :if (or :unless) to pass a Proc that specifies when the
-action should be cached. Also, you can use :layout => false to cache without
+And you can also use `:if` (or `:unless`) to pass a Proc that specifies when the
+action should be cached. Also, you can use `:layout => false` to cache without
layout so that dynamic information in the layout such as logged in user info
or the number of items in the cart can be left uncached. This feature is
available as of Rails 2.2.
@@ -164,15 +164,15 @@ could use this piece of code:
The cache block in our example will bind to the action that called it and is
written out to the same place as the Action Cache, which means that if you
-want to cache multiple fragments per action, you should provide an action_suffix to the cache call:
+want to cache multiple fragments per action, you should provide an `action_suffix` to the cache call:
[source, ruby]
-----------------------------------------------------
<% cache(:action => 'recent', :action_suffix => 'all_products') do %>
All available products:
-----------------------------------------------------
-and you can expire it using the expire_fragment method, like so:
+and you can expire it using the `expire_fragment` method, like so:
[source, ruby]
-----------------------------------------------------
@@ -185,7 +185,7 @@ expire_fragment(:controller => 'producst', :action => 'recent', :action_suffix =
Cache sweeping is a mechanism which allows you to get around having a ton of
expire_{page,action,fragment} calls in your code by moving all the work
-required to expire cached content into a ActionController::Caching::Sweeper
+required to expire cached content into a `ActionController::Caching::Sweeper`
class that is an Observer and looks for changes to an object via callbacks,
and when a change occurs it expires the caches associated with that object n
an around or after filter.

0 comments on commit 5df4a67

Please sign in to comment.