Comments (7)
We've used Kibana to count the number of 304 responses for Mainstream assets from Asset Manager over the last 7 days (http_host:assets.publishing.service.gov.uk AND status:304 AND request:/GET \/media\/.*/ #=> 219,087
).
Mainstream assets are cached for 24 hours. By changing this to 4 hours, we'd expect to see around 6 times the number of requests resulting in 304 responses from Asset Manager (i.e. 1,200,000 instead of 200,000). In the same 7 day period Asset Manager responded to 2,208,911 GET requests (application:asset-manager AND request:/GET.*/
). The additional 1,000,000 requests represents nearly a 50% increase in total requests so it's not obvious this is the way to go.
from asset-manager.
We've used Kibana to count the number of 304 responses for Whitehall assets from Asset Manager over the last 7 days (http_host:assets.publishing.service.gov.uk AND status:304 AND request:/GET \/government\/.*/ #=> 1,047,031
).
Whitehall assets are cached for 4 hours. By changing this to 24 hours, we'd expect to see around 6 times fewer requests resulting in 304 responses from Asset Manager (i.e. 174,505 instead of 1,047,031).
from asset-manager.
We're preparing to start serving about 1.5m Whitehall attachments from Asset Manager so we're currently thinking that it might be better to increase the cache time across the board to 24 hours.
from asset-manager.
@chrislo and I have started working on standardising the caching in #523.
from asset-manager.
The changes in #523 were merged yesterday. I've confirmed that they're working as expected in integration by requesting the same asset from integration and production and comparing the Cache-Control
header. You can see that it was 4 hours in production (the previous value) and it's now 24 hours in integration (the new value).
# Production
$ curl -v "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/person/image/6/s216_PM_portrait_960x640.jpg" > /dev/null
< Cache-Control: max-age=14400, public
# Integration
$ curl -v "https://assets-origin.integration.publishing.service.gov.uk/government/uploads/system/uploads/person/image/6/s216_PM_portrait_960x640.jpg" > /dev/null
< cache-control: max-age=86400, public
from asset-manager.
These changes have now been deployed to production and I've confirmed that the Cache-Control
header is now set to 24 hours:
$ curl -v "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/person/image/6/s216_PM_portrait_960x640.jpg?CJR$RANDOM" > /dev/null
< Cache-Control: max-age=86400, public
from asset-manager.
This is all done. Closing.
from asset-manager.
Related Issues (20)
- Rationalise Mainstream asset filename redirect & Whitehall asset replacement redirect
- Marking Whitehall attachments as deleted should delete corresponding Asset Manager assets when appropriate HOT 7
- Improve the access-limiting implementation
- Update parent_document_url of Whitehall attachments in Asset Manager HOT 2
- Fix setting of draft status for Whitehall attachment assets in Asset Manager HOT 2
- Update redirect_url for replaced assets HOT 2
- Update redirect_url for unpublished/withdrawn assets HOT 2
- NoMethodError in AssetManagerCreateWhitehallAssetWorker HOT 12
- Investigate whether deleted editions break the logic in AttachmentData#significant_attachment HOT 2
- Update metadata of Whitehall attachments in Asset Manager HOT 19
- Investigate possible bug in AttachmentData#last_attachment HOT 2
- Remove attachments from NFS
- Stop CsvPreviewController depending on attachment file existing on the filesystem HOT 2
- It should be possible to update an asset if its replacement has been deleted HOT 1
- Consider adding tests to publishing-e2e-tests repo
- Dependabot can't resolve your Ruby dependency files HOT 1
- Investigate replaced Whitehall attachment on discarded edition HOT 5
- Audit Whitehall attachment metadata in Asset Manager HOT 4
- Ensure all AssetManager-related Sidekiq jobs in Whitehall are idempotent
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 asset-manager.