- For a small performance boost,
defer
option can be set totrue
when configuring any widget module.
This defers calls to theload
method until just before the page is rendered, allowing a single query
to fetch them all in simple cases. This is best applied
to theapostrophe-images-widgets
module and similar widgets. It should not be applied if you wish
to access the results of the join in asynchronous code, because they are not available until the last
possible moment.
Thanks to Michelin for their support of this work.
-
You can also set
deferImageLoading
totrue
for theapostrophe-globals
module if you want the
same technique to be applied when loading theglobal
doc’s widgets. This does not always yield a
performance improvement. -
Bug fix: if two crops of the same image were present in separate widgets on a page, only one of the crops would be seen in template code. This issue has been resolved.