Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Last-Modified HTTP header for raw files #5811

Closed
mdhowle opened this issue Sep 25, 2019 · 2 comments
Closed

Use Last-Modified HTTP header for raw files #5811

mdhowle opened this issue Sep 25, 2019 · 2 comments
Labels
🔨 enhancement Make it better, faster status: needs feedback Tell me more about it

Comments

@mdhowle
Copy link

mdhowle commented Sep 25, 2019

I would like to request Last-Modified HTTP header be added when displaying raw files. This allows wget and other utilities to download the file only if necessary.

Is your feature request related to a problem? Please describe.
I would like to download (e.g. wget -N https://gogs/foo/bar/raw/master/somefile) iff the file was modified.

Describe the solution you'd like
Add the Last-Modified to HTTP headers with the latest time the file was modified in the specified branch: git log -1 --format="%ad" -- somefile

Describe alternatives you've considered

  1. Use releases. This requires some scripting to determine the latest release version, download and extract, and deploy to the location.
  2. Use git pull. Requires installing git on machines that wouldn't otherwise need it.
  3. Download the file regardless of changes. This would waste bandwidth if the file is large or bandwidth is limited.
@unknwon unknwon added 🔨 enhancement Make it better, faster 👋 good first issue Good for newcomers labels Sep 25, 2019
@unknwon
Copy link
Member

unknwon commented Sep 25, 2019

Thanks for the feedback! I think it will be a good addition!

frodeaa added a commit to frodeaa/gogs that referenced this issue Oct 19, 2019
frodeaa added a commit to frodeaa/gogs that referenced this issue Oct 20, 2019
@unknwon unknwon added status: needs feedback Tell me more about it and removed 👋 good first issue Good for newcomers labels Oct 20, 2019
unknwon added a commit that referenced this issue Oct 20, 2019
* repo/download: Add Last-Modified response header

ref: #5811

* Update download.go


Co-authored-by: Unknwon <u@gogs.io>
@unknwon
Copy link
Member

unknwon commented Oct 20, 2019

This is claimed to be fixed by merging #5827, please help test on develop branch or https://try.gogs.io.

@unknwon unknwon closed this as completed Oct 26, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 enhancement Make it better, faster status: needs feedback Tell me more about it
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy