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

Cache preview data? #58

Open
bhrutledge opened this issue May 18, 2015 · 1 comment
Open

Cache preview data? #58

bhrutledge opened this issue May 18, 2015 · 1 comment

Comments

@bhrutledge
Copy link
Contributor

It looks like get_preview_data() is called for every entry in settings.LANGUAGES, but it doesn't depend on the language. If get_preview_data() is non-trivial (e.g., hits the database, builds complex objects), this could be unnecessarily time-consuming. Maybe the preview data could be cached in an instance variable?

@Natim
Copy link
Collaborator

Natim commented May 18, 2015

The reason why we did that is because some implementation of models fields translation return the right translation of a field with regard to the current user language. So in case we change the language we need to refresh this cache anyways

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

No branches or pull requests

2 participants