Commit Graph

89 Commits

Author SHA1 Message Date
Aaron Patterson
8e6f86e298 this should never return nil, so no use for "try" 2011-10-31 15:17:50 -04:00
Christopher Meiklejohn
b23cd21c2d Ensure that the format isn't applied twice to the cache key, else it becomes impossible to target with expire_action. 2011-10-31 15:17:46 -04:00
Jeroen Jacobs
a46d231c79 Fixes an issue where cache sweepers with only after filters would have no controller object
It would raise undefined method controller_name for nil
2011-06-23 17:56:24 +02:00
Ryan Bigg
198f3883fa Proc objects for cache_path for caches_action no longer need controller object, nor to use send when calling routing helpers 2011-03-26 11:34:05 +11:00
R.T. Lechow
87e9e3f9af Action Pack typos. 2011-03-05 11:56:35 +01:00
Cheah Chu Yeow
2ee5555744 Fix Action caching bug where an action that has a non-cacheable response always renders a nil response body. It now correctly renders the response body.
Note that only GET and HTTP 200 responses can be cached.

[#6480 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-02 13:11:07 -02:00
Andre Arko
10cab35d3b Allow page_cache_directory to be set as a Pathname
For example, page_cache_directory = Rails.root.join("public/cache")

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-06 17:55:38 -02:00
Santiago Pastorino
a61e3acef2 html_safe.to_str makes no sense 2011-01-11 18:57:35 -02:00
Rizwan Reza
9dfa06acb4 Edits to caching/fragments. 2010-12-23 16:29:40 +03:30
Santiago Pastorino
ab2bde45f8 Remove require AS::Concern from places where is already in 2010-12-19 19:15:26 -02:00
Santiago Pastorino
f249d07c44 Add missing require 2010-12-19 14:00:08 -02:00
Neeraj Singh
0027b65421 Ensure that while caching a page rails takes into
account the resolved mime type for the request

[#6110 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 16:14:57 +01:00
Xavier Noria
0aa78826e4 makes a pass to the action caching rdoc 2010-12-08 21:20:53 +01:00
Neeraj Singh
3ac844deec Add to documentation that action caching does
handle HTTP_ACCEPT attribute properly and might
provide wrong result. Use params[:format] to
avoid this issue.
2010-12-06 16:38:47 -05:00
Krekoten' Marjan
608bf7b72c AC::Caching DRYup
Remove ActionController::Caching::Pages#caching_allowed
because it duplicates ActionController::Caching#caching_allowed?

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-10-18 17:30:28 -02:00
Emilio Tagua
71acc2737a Move uri parser to AS as URI.parser method to reuse it in AP and ARes. 2010-09-28 11:38:35 +08:00
Emilio Tagua
2f326b7f27 Remove warning "URI.unescape is obsolete" from actionpack.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-27 16:43:04 -03:00
Emilio Tagua
5d773f8ded Remove warning "URI.unescape is obsolete" from actionpack. 2010-09-27 11:19:20 -03:00
Joost Baaij
930102968a Escape 'caching' when used in a sentence; remove unnessesary quotes 2010-08-26 21:58:57 +02:00
Neeraj Singh
db23a95a61 cache_sweeper yields blank output
[#3914 state:open]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 23:20:04 +02:00
Justin George
731d4392e4 Change event namespace ordering to most-significant first [#4504 state:resolved]
More work still needs to be done on some of these names
(render_template.action_view and render_template!.action_view particularly)
but this allows (for example) /^sql/ to subscribe to all
the various ORMs without further modification

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Neeraj Singh
d793d30776 ActionCachingTestController rescues from all exceptions. Making sure that all the tests check for valid response. [#4468 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 12:48:34 +02:00
José Valim
4163ccec23 Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests. 2010-04-22 12:00:13 +02:00
Santiago Pastorino and Carl Lerche
0ea434e2f4 Make perform_caching work again, with the tests passing and backward compatible 2010-04-15 18:25:08 -03:00
Santiago Pastorino
a618ad358a Make use of config.perform_caching 2010-04-14 22:35:13 -07:00
Anil Wadghule
84e46437fa Replace 'RAILS_ROOT' to 'Rails.root' and 'RAILS_ENV' to 'Rails.env' in significant places. 2010-04-12 22:53:49 +05:30
José Valim
4e92134dfa Fix a bug in ActionDispatch::Static where Rails cannot find assets if started in another directory which is not the RAILS_ROOT. 2010-04-08 12:52:37 +02:00
wycats
f868c2afa9 response_body is an Array in 1.9, so an Array was being pushed onto the cache 2010-03-19 18:56:06 -07:00
Carlhuda
71c9337f45 All tests pass without memoizing view_context 2010-03-18 15:52:43 -07:00
Carlhuda
523d0f3700 Remove caching's dependency on view_context. Also, make it so that the layout is always rendered the same way (so that layout dependencies on the action actually being rendered aren't masked on the first render) 2010-03-18 14:55:29 -07:00
Carlhuda
3deb60e6b4 @layout is a confusing name... use @cache_layout 2010-03-18 14:55:29 -07:00
Carlhuda
c61ed70b00 Some more tweaks on <% %>.
* The cache helper is now semantically "mark this region for caching"
  * As a result, <% x = cache do %> no longer works
2010-03-16 11:43:04 -07:00
Jeremy Kemper
748c78ffc8 RJS may cache an array 2010-03-15 23:48:32 -07:00
Carlhuda
9de83050d3 Add deprecation notices for <% %>.
* The approach is to compile <% %> into a method call that checks whether
    the value returned from a block is a String. If it is, it concats to the buffer and
    prints a deprecation warning.
  * <%= %> uses exactly the same logic to compile the template, which first checks
    to see whether it's compiling a block.
  * This should have no impact on other uses of block in templates. For instance, in
    <% [1,2,3].each do |i| %><%= i %><% end %>, the call to each returns an Array,
    not a String, so the result is not concatenated
  * In two cases (#capture and #cache), a String can be returned that should *never*
    be concatenated. We have temporarily created a String subclass called NonConcattingString
    which behaves (and is serialized) identically to String, but is not concatenated
    by the code that handles deprecated <% %> block helpers. Once we remove support
    for <% %> block helpers, we can remove NonConcattingString.
2010-03-15 14:50:43 -07:00
Jeremy Kemper
c937da9e2f to_str works here 2010-03-15 11:18:45 -07:00
Jeremy Kemper
16572fd46e read_ and write_fragment cache preserve html safety yet cache strings only 2010-03-14 19:09:32 -07:00
Jeremy Kemper
47bc138fc1 Write strings to fragment cache, not outputbuffers 2010-03-11 17:43:29 -08:00
Joshua Peek
dcd110c724 skip_relative_url_root url_for option is dead 2010-03-09 21:25:09 -06:00
Carlhuda
3438373f03 Use AS::Concern for caching modules 2010-03-04 16:59:54 -08:00
David Heinemeier Hansson
5ddc597066 Use safe_concat instead of trying to html_safe! what might be a frozen string 2010-01-10 18:13:43 -08:00
David Heinemeier Hansson
5ea130943e Fixed that fragment caching should return a cache hit as html_safe (or it would all just get escaped) [DHH] 2010-01-07 17:45:32 -08:00
José Valim
3990310a2b Use underscore in notification namespaces. 2010-01-04 00:03:56 +01:00
José Valim
6fbe9ef2ff Use namespaces in notifications. 2010-01-03 20:39:42 +01:00
José Valim
75ba102a80 Remove ActionView inline logging to ActiveSupport::Notifications and create ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened. 2009-12-26 20:28:53 +01:00
Yehuda Katz
51c24ae3e3 Caching refactoring 2009-10-29 00:44:12 -04:00
Yehuda Katz
8dcf91ca11 First pass at cleaning up action caching 2009-10-28 16:54:00 -04:00
José Valim
2d7abe245e Renamed Orchestra to Notifications once again [#3321 state:resolved] 2009-10-15 18:51:51 -03:00
José Valim
af0d1fa892 Update Orchestra instrumentations and move part of logging to Orchestra. 2009-10-15 18:18:44 -03:00
José Valim
8b340ab2f6 Revert "Rename Orchestra to Notifications [#3321 state:resolved]"
This reverts commit 8cbf825425.
2009-10-15 18:06:15 -03:00
Joshua Peek
8cbf825425 Rename Orchestra to Notifications [#3321 state:resolved] 2009-10-14 19:50:36 -05:00