mongrel_page_cache_handler 1.6.1 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cacher.rb CHANGED
@@ -8,7 +8,8 @@ module Mongrel
8
8
  if response.status == 200
9
9
  sent = response.header.instance_variable_get("@sent")
10
10
  mcm = sent["mongrel_cache_me"]
11
- if mcm
11
+ imcm = (sent["ignore_mongrel_cache_me"] || false)
12
+ if mcm && !imcm
12
13
  case app_config.page_cache_storage
13
14
  when "cachetastic"
14
15
  # file_path = Mongrel::PageCacheHandler::Utils.build_full_file_path(request, true)
@@ -8,7 +8,7 @@ class ActionController::Base
8
8
  def set_mongrel_page_cache_header
9
9
  if request.get?
10
10
  # puts "Setting mongrel page cache header for: #{params[:controller]}/#{params[:action]}"
11
- response.headers['mongrel_cache_me'] = true
11
+ response.headers['mongrel_cache_me'] = !@ignore_page_caching
12
12
  else
13
13
  # puts "Won't set mongrel page cache header because the request was not a GET."
14
14
  end
@@ -2,4 +2,4 @@
2
2
  gem_name: mongrel_page_cache_handler
3
3
  package: mongrel_page_cache_handler
4
4
  project: magrathea
5
- version: 1.6.1
5
+ version: 1.6.4
data/lib/utils.rb CHANGED
@@ -9,9 +9,11 @@ module Mongrel
9
9
  if ActionController::Base.perform_caching
10
10
  if request.params[Mongrel::Const::REQUEST_METHOD] == "GET"
11
11
  case request.params[Mongrel::Const::PATH_INFO]
12
+ when /\.xml$/ ## CHANGEME
13
+ yield request, response if block_given? ## CHANGEME
12
14
  when /\.[a-zA-Z]*$/
13
15
  else
14
- yield request, request if block_given?
16
+ yield request, response if block_given? ## CHANGEME
15
17
  end
16
18
  end
17
19
  end
@@ -62,7 +64,7 @@ module Mongrel
62
64
 
63
65
  def build_path(request)
64
66
  path = request.params[Mongrel::Const::PATH_INFO]# + ActionController::Base.page_cache_extension
65
- if path == "/"
67
+ if path == "/" or path.nil? or path == '' # CHANGEME
66
68
  path = "/index"
67
69
  end
68
70
  path
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: mongrel_page_cache_handler
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.6.1
7
- date: 2007-12-21 00:00:00 -05:00
6
+ version: 1.6.4
7
+ date: 2008-01-08 00:00:00 -05:00
8
8
  summary: mongrel_page_cache_handler
9
9
  require_paths:
10
10
  - lib