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

Exclude next/previous contents from indexes #154

Merged
merged 3 commits into from Aug 20, 2016
Merged

Conversation

benbalter
Copy link
Contributor

A follow up to #138, #138 removed the content fields from documents when retrieving an index... but we still included the content of the next/previous document, and did so recursively.

So while the document itself had no content, for each document we loaded, we loaded up to four document's contents in the next/previous fields.

This PR updates the to_api logic to not include the content of nor the next/previous document for other documents when generating a given document's next/previous fields.

Before

{
  "path": "whatever",
  "next" {
    "path": "something",
    "content": "foo",
    "next": { 
     ...
    } 
    ...
  }
}

After

{
  "path": "whatever",
  "next" {
    "path": "something"
    ...
  }
  ...
}

I don't believe next/previous was used by the front end, and thus no front end change should be necessary. This does however, make document lists load significantly faster on large sites.

@mertkahyaoglu
Copy link
Member

👍🏻

@benbalter benbalter merged commit 342b009 into master Aug 20, 2016
@benbalter benbalter deleted the remove-adjacent branch August 20, 2016 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants