1

Knowing the fact that DXA expects all items including binaries to be published to the CD Broker database and it will cache binaries on file system of the web application server. But if we do a new EAR deployement, these cached binaries will get deleted.
Question:
Kindly suggest how to retain these cached binaries as it is, after a new deployment? So that we can reduce the DB hits.
Update:
If we do a new deployment too then those cached binaries will get deleted. So if anyone try to access these files, again application will hit the DB to fetch the binary and then it will get cached for next request. To avoid this DB hits only i am looking for a suggestion if any how we can prevent cached binaries to get deleted.

  • The /admin/refresh action is intended to force clear/reload any cached config settings. AFAIK, it shouldn't remove cached files (if the underlying binaries didn't change), but I'm not sure why you care? Are you using /admin/refresh that often? – Rick Pannekoek Feb 6 at 15:52
  • DXA Java or .NET ? – Rick Pannekoek Feb 6 at 15:52
  • Hi @RickPannekoek, Admin refresh, Server restart are just an example, if we do a new deployment too then those cached binaries will get deleted. So if anyone try to access these files, again application will hit the DB to fetch the binary and then it will get cached for next request. To avoid this DB hits only i was looking for a suggestion if any how can we prevent cached binaries to get deleted. – SDLBeginner Feb 7 at 8:24
  • AFAIK usually, BinaryData images if it already downloaded and exists it will not delete and it will check the metadata for the image modified date for re-download the image from the broker DB if there is any change in the image? – Velmurugan Feb 7 at 8:44
  • @Velmurugan, I crossed checked and found that the Binaries are not getting deleted on server restart or Admin refresh. But getting deleted if we are doing any EAR deployment. I will update my question accordingly. – SDLBeginner Feb 7 at 10:03
2

Option1: Try to use the persistent storage mapping in your web app, for example, try to use EFS (NFS storage) symbolic or soft link folder map to your web application for BinaryData folder so that every time if you do deployment it will not be getting deleted images folder.

Option2: Alternatively, a possibility OOTB you could also achieve this by publishing the binaries to the filesystem and create custom DXA BinaryProvider and use to get the images from filesystem directly without CIL and database calls.

I hope it helps

  • Thank you for the suggestions @Velmurugan. – SDLBeginner Feb 8 at 8:22

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.