From 011e55bd4acf4f3c9de91c5ed4c646e855f19c24 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Fri, 24 May 2013 14:42:43 +0100 Subject: Only cache attachments that are returned with a 200 HTTP status code Otherwise redirects will be cached, and since headers and the status code aren't stored, a non-redirecting redirect page will be returned in the future, but with 200. It's easiest to only cache the 200 responses. --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 96f62319e..b8ccdf926 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -721,7 +721,7 @@ class RequestController < ApplicationController yield - if params[:skip_cache].nil? + if params[:skip_cache].nil? && response.status == 200 # write it to the fileystem ourselves, so is just a plain file. (The # various fragment cache functions using Ruby Marshall to write the file # which adds a header, so isnt compatible with images that have been -- cgit v1.2.3