[plone.scale] Deferred creation of scales?

As part of a migration, we import 30.000 images over plone.restapi. The site has about 28 different scales (the sense of this number is a different discussion) but this wastes a lot of time and space during the migration.

  1. is there a way to defer the creation of image scale until they are used?
  2. is it safe to clear the underlaying annotation (ScaleDict)? Will Plone re-create one scale or all scale if requested/needed?
  1. AFAIK. No. Last week I made a plone.namedfile branch that defers them for fast REST API response, but it comes with a async worker to fill the space immediately.

  2. Yes. Deletion is safe.

1 Like

Is it this branch here?

Yes.

I added the branch to our migration buildout and it clearly provides a significant improvement for us. Creating an image over plone.restapi (with 30 scales in our cases) take about 2-2,5 seconds in average (for "normal" images)..this went down to about 500ms which is great improvement when you have to migration about 30.000 images^^

Minor improvement: the logging message from the ScalingQueueProcessorThread should use the DEBUG log level...too much noise on the console otherwise.

Thank you for this great contribution.

4 Likes

Plone Foundation Code of Conduct