# Know if study is cached

**URL:** https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902
**Category:** Google Groups archive
**Created:** [May 4, 2022, 11:09pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902 "2022-05-04T23:09:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rmasad](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/rmasad/32/1727_2.png) [@rmasad](https://discourse.orthanc-server.org/u/rmasad)
#### Post date: [May 4, 2022, 11:09pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/1 "2022-05-04T23:09:12Z")

</div>

How can we know if there is a compressed file (.zip) of a study in the cache?

We looked in the Rest API and we did not find a mechanism to know if the .zip exists in the cache or not.

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [May 5, 2022, 5:06am UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/2 "2022-05-05T05:06:53Z")

</div>

Orthanc never caches the .ZIP files it generates.

You might be looking for the asynchronous generation of archives:  
[https://book.orthanc-server.com/users/advanced-rest.html#example-asynchronous-generation-of-an-archive](https://book.orthanc-server.com/users/advanced-rest.html#example-asynchronous-generation-of-an-archive)

---

<div class="post-metadata">

### Author: ![rmasad](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/rmasad/32/1727_2.png) [@rmasad](https://discourse.orthanc-server.org/u/rmasad)
#### Post date: [May 6, 2022, 3:13pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/3 "2022-05-06T15:13:16Z")

</div>

I mean to know which studies are already compressed and stored, to download them again and not create them again: [https://hg.orthanc-server.com/orthanc/file/Orthanc-1.10.1/OrthancServer/Resources/Configuration.json#l709](https://hg.orthanc-server.com/orthanc/file/Orthanc-1.10.1/OrthancServer/Resources/Configuration.json#l709)

---

<div class="post-metadata">

### Author: ![diegovictorbr](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/diegovictorbr/32/1586_2.png) [@diegovictorbr](https://discourse.orthanc-server.org/u/diegovictorbr)
#### Post date: [May 6, 2022, 3:32pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/4 "2022-05-06T15:32:08Z")

</div>

Hello!

If what Sebastien says is true, then I think MediaArchiveSize simply means the number of files Orthanc can handle in parallel and **asynchronous** mode, and **delete** after the job is finished (presumably after the file is downloaded).

A sexta-feira, 6 de maio de 2022 à(s) 16:13:16 UTC+1, [rma...@gmail.com](mailto:rma...@gmail.com) escreveu:

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [December 23, 2022, 2:26pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/5 "2022-12-23T14:26:35Z")

</div>

Hello,

You can simply use the “/jobs?expand” URI to get information about all the jobs that have been handled in Orthanc:  
[https://api.orthanc-server.com/#tag/Jobs/paths/~1jobs/get](https://api.orthanc-server.com/#tag/Jobs/paths/~1jobs/get)

Secondly, locate all the jobs whose “Type” equals “Archive” and whose “Status” equals “Success”. Finally, try to retrieve the “/jobs/…/archive” item, as described here:  
[https://book.orthanc-server.com/users/advanced-rest.html#example-asynchronous-generation-of-an-archive](https://book.orthanc-server.com/users/advanced-rest.html#example-asynchronous-generation-of-an-archive)

If the request to “/jobs/…/archive” succeeds, you have located one already archived DICOM resource.

Sébastien-

---

<div class="post-metadata">

### Author: ![rmasad](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/rmasad/32/1727_2.png) [@rmasad](https://discourse.orthanc-server.org/u/rmasad)
#### Post date: [January 16, 2023, 2:57pm UTC](https://discourse.orthanc-server.org/t/know-if-study-is-cached/2902/6 "2023-01-16T14:57:23Z")

</div>

Thanks Sébastien. We will try this approch.

Rafik
