Commit a8647264 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch...

Merge branch '35337-images-stopped-loading-signed-urls-of-uploads-expire-earlier-than-redirect-cache' into 'master'

Resolve "images stopped loading: signed URLs of uploads expire earlier than redirect cache"

See merge request gitlab-org/gitlab!19494
parents 8e1deb2a 676d7ec6
......@@ -34,7 +34,7 @@ module UploadsActions
headers['Pragma'] = ''
ttl, directives = *cache_settings
ttl ||= 6.months
ttl ||= 0
directives ||= { private: true, must_revalidate: true }
expires_in ttl, directives
......
---
title: Disable upload HTTP caching to fix case when object storage is enabled and
proxy_download is disabled
merge_request: 19494
author:
type: fixed
......@@ -7,9 +7,9 @@ shared_examples 'content 5 min private cached with revalidation' do
end
end
shared_examples 'content long term private cached with revalidation' do
shared_examples 'content not cached' do
it 'ensures content will not be cached without revalidation' do
expect(subject['Cache-Control']).to eq('max-age=15778476, private, must-revalidate')
expect(subject['Cache-Control']).to eq('max-age=0, private, must-revalidate')
end
end
......@@ -490,7 +490,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content long term private cached with revalidation' do
it_behaves_like 'content not cached' do
subject do
get :show, params: { model: 'note', mounted_as: 'attachment', id: note.id, filename: 'dk.png' }
......@@ -510,7 +510,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content long term private cached with revalidation' do
it_behaves_like 'content not cached' do
subject do
get :show, params: { model: 'note', mounted_as: 'attachment', id: note.id, filename: 'dk.png' }
......@@ -563,7 +563,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content long term private cached with revalidation' do
it_behaves_like 'content not cached' do
subject do
get :show, params: { model: 'note', mounted_as: 'attachment', id: note.id, filename: 'dk.png' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment