Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
7df8c8c2
Commit
7df8c8c2
authored
10 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
apply some cache headers to try to make the content repo less nutso
parent
217c082a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/content_repository.py
+8
-0
8 additions, 0 deletions
synapse/http/content_repository.py
with
8 additions
and
0 deletions
synapse/http/content_repository.py
+
8
−
0
View file @
7df8c8c2
...
...
@@ -129,6 +129,14 @@ class ContentRepoResource(resource.Resource):
logger
.
info
(
"
Sending file %s
"
,
file_path
)
f
=
open
(
file_path
,
'
rb
'
)
request
.
setHeader
(
'
Content-Type
'
,
content_type
)
# cache for at least a day.
# XXX: we might want to turn this off for data we don't want to recommend
# caching as it's sensitive or private - or at least select private.
# don't bother setting Expires as all our matrix clients are smart enough to
# be happy with Cache-Control (right?)
request
.
setHeader
(
'
Cache-Control
'
,
'
public,max-age=86400,s-maxage=86400
'
)
d
=
FileSender
().
beginFileTransfer
(
f
,
request
)
# after the file has been sent, clean up and finish the request
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment