# How to precompile Oxygen?

**URL:** <https://discourse.julialang.org/t/how-to-precompile-oxygen/125834>\
**Category:** General Usage\
**Tags:** question, package, oxygenjl\
**Created:** [February 12, 2025, 4:15pm UTC](https://discourse.julialang.org/t/how-to-precompile-oxygen/125834 "2025-02-12T16:15:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [February 12, 2025, 4:15pm UTC](https://discourse.julialang.org/t/how-to-precompile-oxygen/125834/1 "2025-02-12T16:15:57Z")

</div>

I am using the web server Oxygen.jl . I use it to call functions using json over http. I want to create a system image to avoid the high time-to-first-reply.

My question:

In the precompile script I want to start Oxygen, it shall serve each possible query once and than it shall shut down. How can I achieve that?

---

<div class="post-metadata">

**Author:** ![Janis\_Erdmanis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janis_erdmanis/32/10869_2.png) [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Post date:** [February 12, 2025, 4:56pm UTC](https://discourse.julialang.org/t/how-to-precompile-oxygen/125834/2 "2025-02-12T16:56:10Z")

</div>

You may want to look into Oxygen test sets. There are plenty of examples of how to call the endpoints. You can then collect those for a precompile script and try to compile them with PackageCompiler. I haven’t tried that though.

An alternative I would personally use would be `PrecompileTools`. With it, you can create a precompile workload and call each endpoint which would then be added to the package image. Note for that to work you would need to use the `@oxidise` macro.
