mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Suggest a workaround for page caching and parameters instead of an unhelpful warning.
This commit is contained in:
parent
a02b40a3d2
commit
650ec898e5
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ end
|
|||
|
||||
If you want a more complicated expiration scheme, you can use cache sweepers to expire cached objects when things change. This is covered in the section on Sweepers.
|
||||
|
||||
NOTE: Page caching ignores all parameters. For example +/products?page=1+ will be written out to the filesystem as +products.html+ with no reference to the +page+ parameter. Thus, if someone requests +/products?page=2+ later, they will get the cached first page. Be careful when page caching GET parameters in the URL!
|
||||
NOTE: Page caching ignores all parameters. For example +/products?page=1+ will be written out to the filesystem as +products.html+ with no reference to the +page+ parameter. Thus, if someone requests +/products?page=2+ later, they will get the cached first page. A workaround for this limitation is to include the parameters in the page's path, e.g. +/productions/page/1+.
|
||||
|
||||
INFO: Page caching runs in an after filter. Thus, invalid requests won't generate spurious cache entries as long as you halt them. Typically, a redirection in some before filter that checks request preconditions does the job.
|
||||
|
||||
|
|
Loading…
Reference in a new issue