Skip to content
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

Closed
wants to merge 11 commits into from

Conversation

QuarpT
Copy link
Contributor

@QuarpT QuarpT commented Nov 29, 2017

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

@PRBuilds
Copy link

PRBuilds commented Nov 29, 2017

PRbuilds results:

Screenshots
desktop.pngtablet.pngmobile.pngwide.png

💚 Exceptions
thrown-exceptions.js

💚 A11y validation
a11y-report.txt

Apache Benchmark Load Testing
loadtesting.txt

💚 Microdata Validation
microdata.txt

--automated message

Copy link
Contributor

@TBonnin TBonnin left a 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] = {
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

@TBonnin TBonnin Nov 30, 2017

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?

Copy link
Contributor Author

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

@QuarpT QuarpT changed the base branch from pcolley/remove_s3_wsclient to master November 30, 2017 15:49
@TBonnin TBonnin closed this Dec 5, 2017
@TBonnin TBonnin deleted the pcolley/facia_render_show_more_and_lite branch December 5, 2017 12:21
@TBonnin
Copy link
Contributor

TBonnin commented Dec 5, 2017

See #18365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants