MobileApps: Switch to key_value and spec modules #420
Merged
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 PR brings many changes to the MobileApps endpoints in RESTBase. Firstly, this a disruptive change for the public API:
/page/mobile-html
ceases to exist-html
is being dropped from route names of the other endpointsSecondly, we now store only the latest render for each title, and do so only for the
mobile-sections
endpoint. Two key_value buckets are used for that:mobileapps.lead
andmobileapps.remaining
, each storing a part of the response, respectively so that they can be served efficiently, being more popular then the mainmobile-sections
route.Thirdly, with regards to refreshing the content, only the
mobile-sections
route causes content to be regenerated; sending ano-cache
request tomobile-sections-lead
andmobile-sections-remaining
will cause RESTBase to simply return the latest stored content.Finally, all of the paths have been simplified and moved out of the configuration file into its own spec module.
This PR also brings some improvements and fixes. Namely:
Content-Type
checks in tests have the additional (now-required)charset
componentreturn_if
to the list of components determining if a request is simple or nothasOwnProperty()
to check if a function for a route/method has been defined