4

I have a Component with many large images in it. Sometimes we change 1 image, and need to re-publish the Component resulting in all images being published again, with the PublishBinary API call.

I would like to see how to not re-publish all images. One idea would be to check the page last publish time and compare it with the image last modified time in a custom resolver, and remove images that are older than the last publish time.

Is this a crazy idea or has it already been done before?

Is there a better way?

  • 1
    I'd go one step further and add the CD Web Service to a box connected to your CD database, and check against that for the version of the binary published - then decide if it needs updating... – Nuno Linhares May 7 '14 at 13:43
  • And is a custom resolver the best (or only) place to remove the images to not publish? – robrtc May 7 '14 at 13:46
  • 1
    Custom resolver is the best place, in my opinion. – Nuno Linhares May 7 '14 at 14:23
  • 2
    One thing I'm wondering about is the used counter of the images, when you remove the AddBinary() call for certain image, the Delivery side might decrease the usage counter for that image, and if it is null, it might delete the image from the delivery side... Please note I'm saying 'might', you would have to check it. – Bart Koopman May 7 '14 at 14:28
  • 1
    Do customer resolvers change the behavior of AddBinary()? I thought items added to the package by templates aren't seen in "items to publish" (and are separate from the resolving rules). – Alvin Reyes May 8 '14 at 2:12
5

Your idea makes perfect sense to me. you can use it for sure.

I have one more:

  1. publish the Images dynamically one by one, when needed.
  2. stop publishing the dependent images while publishing the page/Component using Custom Resolver

I understand this could have impact of your solution design, but still an option.

  • 1
    We have done a similar solution but resolving the Image URL in the Template instead. It does require the user to publish the images first, but saves a lot of time during publishing. – robrtc Nov 21 '14 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.