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.
1 Answer
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
/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?