Spike: Can we serve content directly from Publishing API? #2602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello card / Spike notes document
A short spike to answer the question: could we, if we so decided, serve the GET requests which currently go to content-store, directly from publishing-api?
This does the minimum viable work to prove that concept. It adds a content_store/content_items_controller to serve unauthenticated
GET
requests on/content-store/(live or draft)/(base_path)
and respond with the appropriateDownstreamPayload
representation of the relevant edition:Testing on a local laptop shows a response time that can vary between 35ms for pages with few links, to 1.5s for pages with hundreds of links such as FCDO. This isn't fast enough for production use as-is, but it's at least sufficiently close at the faster end to the c10ms content-store response time that we could imaging getting there with additional performance engineering and caching.
(There are many other reasons why this PR is a long way from production-ready, discussed in the Spike notes document linked above.)
This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.