-
Notifications
You must be signed in to change notification settings - Fork 554
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
Facia presses 'lite' versions of fronts as well as full versions #18364
Conversation
PRbuilds results: Screenshots 💚 Exceptions 💚 A11y validation Apache Benchmark Load Testing 💚 Microdata Validation --automated message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some small comments but it looks good to me. I think this is going to be a huge improvement. Thank you
@@ -31,6 +32,16 @@ object Container extends Logging { | |||
def fromConfig(collectionConfig: CollectionConfig): Container = | |||
resolve(collectionConfig.collectionType) | |||
|
|||
def maxStories(collectionConfig: CollectionConfig, items: Seq[PressedContent]): Option[Int] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would storiesCount
would be a better name for this function?
putPressedJson(path, json) | ||
.map { pressedFronts: PressedPageVersions => | ||
putPressedPage(path, pressedFronts.full, FullType) | ||
putPressedPage(path, pressedFronts.lite, LiteType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happen if one of the put fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the two pressed files will not match and the error will be logged.
This shouldn't be a problem. It's already possible for the pressed page to be updated between the browser retrieving the initial pressed page, and the show-more request.
@@ -23,6 +23,7 @@ class Application(liveFapiFrontPress: LiveFapiFrontPress, draftFapiFrontPress: D | |||
|
|||
def generateLivePressedFor(path: String): Action[AnyContent] = Action.async { request => | |||
liveFapiFrontPress.getPressedFrontForPath(path) | |||
.map(_.full) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a route like /pressed/live/*path.lite
so we can get the lite version of the pressed front as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do, I will add it
See #18365 |
What does this change?
Facia presses 'lite' versions of fronts as well as full versions. For most requests, Facia does not need an full pressed front. This is an optimisation.
I will change the base branch to master after the dependent feature branch is merged.
What is the value of this and can you measure success?
Facia can process smaller Json files, more performant - it will be able to handle a higher request rate.
Tested in CODE?
I will