Comments (3)
As a workaround, for anyone using drone via reverse proxy like nginx.
You can always tell nginx to add Cache-Control no-cache
header,
I use something like this on my instance:
location ~ ^/img/build_.+\.png$ {
proxy_pass http://drone;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
add_header Cache-Control no-cache;
}
As for drone itself, it looks like we should use custom handler and use
http.ServeFile instead, then we can check r.URL.Path and set Cache-Control header
if it requests for /img/build_*.png. @bradrydzewski what do you think?
from gitness.
ahh, I might know the issue
We are setting cache-control headers for all requests:
https://github.com/drone/drone/blob/master/cmd/droned/drone.go#L178
However, this doesn't include our static assets:
https://github.com/drone/drone/blob/master/cmd/droned/drone.go#L73
We are serving the images using http.ServeFile:
http.Handle("/img/", http.FileServer(box.HTTPBox()))
We can probably wrap the FileServer in a function that, as you suggested, inspects the URL path and applies the cache-control
header if /img/build_*.png
from gitness.
ok, added a fix here
https://github.com/drone/drone/blob/master/cmd/droned/drone.go#L80
from gitness.
Related Issues (20)
- Drone use PAT owner account for git commit HOT 1
- Cannot use expression variables in pipeline HOT 2
- feat: is it possible to recreate frontend(web) with nextjs? HOT 1
- The pipelines are unable to function properly when reading secrets. HOT 1
- any plan to release public cloud hosting? HOT 1
- Deploying Code on Different Runners based on Branches in Drone CI/CD HOT 1
- Helm chart missing index file HOT 1
- Opensource Website? HOT 1
- Git HTTPS Protocol - New Branch Creation Rule Not Blocking Push from CLI but Works via UI HOT 2
- Project and repo deletion actually do not delete the db spaces + repos, and do not free disk space HOT 1
- Pipeline Only Mode HOT 1
- Bug: Improve public repositories experience when visited HOT 1
- Feature request: explore tab
- Using drone is a real pain
- Gitness Integration with Open Source Dev Environment Manager. HOT 2
- Gitness Integration support HOT 1
- Gitness Api HOT 3
- Error: Changes blocked by files exceeding the file size limit HOT 2
- using pipelines with Docker-in-Docker samples, Error: mount: permission denied
- Gitness - Unauthenticated Git Pulls HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitness.