lektor / lektor-website

The main lektor website.
https://www.getlektor.com/
Other
160 stars 134 forks source link

Cache project data for reuse #206

Open nixjdm opened 6 years ago

nixjdm commented 6 years ago

Post #194

The project_data plugin that grabs information from pypi, github, etc currently makes one request per project per relevant template query. This means there are redundant requests being made. This adds build time. The requests actually make up most of the build time for the site. This can be cut back significantly if we cache the results of the first time a project's data is queried for, and then check for that cache and reread it instead o making the same query again.

Ideally I think, the data would be cached on first use, and reread from the cache until the build dir is cleaned. So then if you wanted to force a refresh, you'd just run lektor clean, otherwise, you'd just not worry about it.