Prevent Browsers from caching downloaded documents

This commit is contained in:
Karel Picman 2017-07-11 16:08:19 +02:00
parent 97114d4a28
commit 77a6462e5b
3 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,8 @@ class DmsfController < ApplicationController
end
def download_email_entries
# IE has got a tendency to cache files
expires_in(0.year, "must-revalidate" => true)
send_file(
params[:path],
:filename => 'Documents.zip',

View File

@ -65,6 +65,8 @@ class DmsfFilesController < ApplicationController
else
title_format = Setting.plugin_redmine_dmsf['dmsf_global_title_format']
end
# IE has got a tendency to cache files
expires_in(0.year, "must-revalidate" => true)
send_file(@revision.disk_file,
:filename => filename_for_content_disposition(@revision.formatted_name(title_format)),
:type => @revision.detect_content_type,

View File

@ -30,6 +30,8 @@ class DmsfPublicUrlsController < ApplicationController
if dmsf_public_url
revision = dmsf_public_url.dmsf_file.last_revision
begin
# IE has got a tendency to cache files
expires_in(0.year, "must-revalidate" => true)
send_file(revision.disk_file,
:filename => filename_for_content_disposition(revision.name),
:type => revision.detect_content_type,