Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Store BlogPost preview in the database #98

Open
garrettr opened this issue Feb 4, 2017 · 0 comments
Open

Store BlogPost preview in the database #98

garrettr opened this issue Feb 4, 2017 · 0 comments

Comments

@garrettr
Copy link
Contributor

garrettr commented Feb 4, 2017

Currently, the preview blurb displayed for each BlogPost on the BlogIndexPage is re-computed every time the page is loaded (since it is an @property attribute on the model). It would be better to memoize this computation and only store it when the BlogPost changes. The easiest way to do this is to add a preview field to BlogPost and use a custom save method to compute and save the preview only when necessary.

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

No branches or pull requests

1 participant