Proof of concept: Routing by schema_name#593
Draft
KludgeKML wants to merge 5 commits into
Draft
Conversation
- Publish intents allow a fast switchover by reducing the content expiry passed to the frontend so that items that are scheduled to be published don't get cached past their update time and thus apparently miss their scheduled time if the viewer recently viewed the page. However, this is of less utility now that our cache times are closer to 5 mins, and we could easily say that the default expiry time of 404s is 1 minute, making the site almost as snappy with less complexity.
- this should probably be loaded from a YAML file, but I can't work out how go's yaml handling would allow me to end up with map[string]string
- remove references to Mongo and router-api, add reference to content-store
- We remove the part of the query that asks for the backend id, instead trusting that the schema_map correctly points us from a schema to the correct handler (this is correct for everything except for special routes, which will be handled later). - update the unit tests to point to use actual schemas (this isn't necessarily the best idea, possibly we should provide a synthetic schema mapping for the tests, but it'll do for now).
1aa1014 to
45e970c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a proof of concept of moving the information about which documents should be routed to which rendering apps to where it's actually critical - in router.
This would allow the publishing app chain (the originating app, publishing-api, and content-store) to not care about which app renders a particular document.
This is not good Go code, but 🤷. Hopefully it will be able to show that everything works, and someone better than me can rewrite it.