Orthanc as a cache server

I am wondering if orthanc could be used as a cache-ish server. I am not good explaining it so I’ll put 2 examples to help you undertand better:

Case 1 (orthanc has the studies):

  • Workstation ask a study to orthanc server with ip port 4242 (dicom protocol)
  • Orthanc check if it has that study and sends it back to the workstation
  • Workstation receives it and does whatever it needs to.

Case 2 (orthanc does not have the studies:

  • Workstation ask a study to orthanc server with ip port 4242 (dicom protocol)
  • Orthanc check if it has that study, it does not, so orthanc retrieves automatically the study from other instance of orthanc (ip that it does have the study
  • Orthanc instance with ip send the study to Workstation
    Is it possible to do something like that, retrieve the study from other instance making this process invisible to the workstation (not having to ask the orthanc directly)?
    I was thinking doing it via reverse proxy with apache, something like checking first if it has the study running some script or whatever and if it does not retrieving it, but im not to sure if it can be done like that.
    Wht’s your opinion? Help will be so much appreciated.


An Apache reverse proxy won’t work, as you are dealing with the DICOM protocol (and not the HTTP protocol).

The behavior you request can be implemented as a C/C++ plugin for Orthanc:

Check out the “OrthancPluginRegisterFindCallback()” and “OrthancPluginRegisterMoveCallback()” in the SDK documentation.


Thanks for your answer,

I’ve decided to implement my own plugin but I know nothing about cmake + export to a dll/so. I’ve tried to obtain it via eclipse, but when i tried to add it to my orthanc it says “does not declare the proper entry functions”. At the moment my plugin only has:

  • OrthancCPlugin.h
  • json.c and json.h
  • OrthancContext.cpp and OrthancContext.h
  • Plugin.cpp, this file contains OrthancPluginInitialize, OrthancPluginFinalize, OrthancPluginGetName, OrthancPluginGetVersion and OrthancPluginRegisterMoveCallback (not sure if this should be here)

Why Orthanc isn’t getting my entry points? How should this be made in a cmake file?

This question has been partly answered in another thread (please avoid opening many threads for discussing the same question):

Your plugin is most probably not seeing your entry points because they are not tagged as “extern “C””:

Check out the code of the official C++ plugins, for instance “ServerFolders” that is probably the most simple sample: