-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ensure Whitehall assets are being served from the asset host #348
Comments
I was originally planning to do this by adding a redirect in the Whitehall routes file but @danielroseman has suggested that we might be able to do it by adding a redirect route to the router. I opened alphagov/govuk-puppet#6890 in preparation for adding the redirect to Whitehall and my WIP branch is https://github.com/alphagov/whitehall/tree/redirect-asset-requests-to-asset-host. |
I've investigated implementing this redirect by adding routes to the router and it certainly looks possible. I think we'd need to add a route for each of the following folders on disk that are currently being served by the
Note that we don't have to add a redirect for /government/uploads/system/uploads/attachment_data as that will continue to be served by Whitehall's I've tested this in integration by adding a redirect for people images:
|
I've opened alphagov/whitehall#3627 to do this redirection in the Whitehall app. |
I've merged alphagov/whitehall#3627 and will test the behaviour once it's been deployed to integration. |
This has been deployed to integration and I've confirmed that it's working as expected:
I'll aim to get it deployed to staging and production tomorrow. |
I've just merged #364 and I'd like to test those changes on integration before they are deployed to staging/production. |
I've realised that alphagov/whitehall#3627 will also redirect requests for HMRC's Basic PAYE Tools files. We don't know how the software handles redirects and so I've opened alphagov/whitehall#3636 to explicitly avoid redirecting these requests. We're tracking the migration of HMRC assets in issue #217. |
The changes in alphagov/whitehall#3627 and alphagov/whitehall#3636 have now been deployed to production. I've confirmed that non-HMRC assets are now being redirected to the asset host as expected:
While chatting to @floehopper, we realised that we're using a temporary (302) redirect where we should probably be using a permanent (301) redirect. I've captured this in issue #366. |
I think this is all done for now. Closing. |
Assets in Whitehall can be accessed using both www.gov.uk and assets.publishing.service.gov.uk. These two URLs respond with the same image of Theresa May, for example:
The majority of asset URLs in the wild use the asset host but there are some using www.gov.uk. The "Heathrow expansion: revised draft Airports National Policy Statement" consultation contains a link to this response form that uses www.gov.uk, for example.
We want to serve all assets using the asset host only so that we can configure things like caching and routing in a single place.
I've extracted this from issue #297 (Migrate Consultation Response Forms to Asset Manager) as it affects more than just consultation response forms.
The text was updated successfully, but these errors were encountered: