Closed zopyx closed 6 years ago
Hi,
get_plugin_names()
is used to aggregate JS and CSS resources to deliver and to initialize the factory with addon blueprints.
The return value is unique, thus can safely be cached.
We have indication that the related resources are never cached and reloaded with every request independent of its URL..this slows down sites. Some caching at some level is needed.
Some caching at some level is needed.
True. As first step i added caching for get_plugin_names
here https://github.com/bluedynamics/yafowil/commit/0fd7c1a4054009359bf4033dc4a7c8beee7ba135. May you be so kind and check whether this improves the situation?
The second improvement must be caching of https://github.com/bluedynamics/yafowil.plone/blob/master/src/yafowil/plone/resources.py#L66. I'll have a look at it within the next days, need to finish some other stuff first.
I have tested this. It seems to improve loading of yafowil.plone.js if I load it directly , e.g. http://localhost:8082/uni3/yafowil.plone.js?version=None
But I can not see any improvement during start page load:
As part of debugging session of Plone 5 I came across the problem that one request triggers two calls to
yafowil.utils.get_plugin_names()
per request with an execution time of about 0.5 to 0.7 per seconds.1) The calls are not cached (not sure if the result should cachable)
2)
yafowil.plone
seems to be used inside a test fixtureNot sure why
get_plugin_names()
is called inside our production setup.