From e25466b142c067ad44130d93fa864f5ffa9643bb Mon Sep 17 00:00:00 2001 From: Anton Khamets Date: Fri, 11 Aug 2017 20:18:12 +0300 Subject: Enable browser caching for blobs and variants (#30196) --- activestorage/app/controllers/active_storage/blobs_controller.rb | 1 + activestorage/app/controllers/active_storage/variants_controller.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'activestorage/app/controllers/active_storage') diff --git a/activestorage/app/controllers/active_storage/blobs_controller.rb b/activestorage/app/controllers/active_storage/blobs_controller.rb index 05af29f8b2..cff88bd488 100644 --- a/activestorage/app/controllers/active_storage/blobs_controller.rb +++ b/activestorage/app/controllers/active_storage/blobs_controller.rb @@ -5,6 +5,7 @@ class ActiveStorage::BlobsController < ActionController::Base def show if blob = find_signed_blob + expires_in 5.minutes # service_url defaults to 5 minutes redirect_to blob.service_url(disposition: disposition_param) else head :not_found diff --git a/activestorage/app/controllers/active_storage/variants_controller.rb b/activestorage/app/controllers/active_storage/variants_controller.rb index 994c57aafd..b72b0ff7f5 100644 --- a/activestorage/app/controllers/active_storage/variants_controller.rb +++ b/activestorage/app/controllers/active_storage/variants_controller.rb @@ -5,6 +5,7 @@ class ActiveStorage::VariantsController < ActionController::Base def show if blob = find_signed_blob + expires_in 5.minutes # service_url defaults to 5 minutes redirect_to ActiveStorage::Variant.new(blob, decoded_variation).processed.service_url(disposition: disposition_param) else head :not_found -- cgit v1.2.3