# Persistent\_term for static assets using Plug?

**URL:** <https://forum.elixirforum.com/t/persistent-term-for-static-assets-using-plug/34295>\
**Category:** Discussions\
**Tags:** plug, phoenix, static-assets\
**Created:** [September 10, 2020, 9:06pm UTC](https://forum.elixirforum.com/t/persistent-term-for-static-assets-using-plug/34295 "2020-09-10T21:06:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [September 11, 2020, 8:43am UTC](https://forum.elixirforum.com/t/persistent-term-for-static-assets-using-plug/34295/4 "2020-09-11T08:43:32Z")

</div>

> [@voltone](#):
>
> It might be interesting to run some more tests with different file sizes and transmission rates (preferably on a real network interface). Maybe the optimal solution is a mix, serving small files from persistent\_term while falling back to `sendfile/5` for large files.

IIRC there will be no difference as soon as the files are in memory. The difference would be only if the files are served from the FS, as then `sendfile` can work fully within kernel, without going through user space.

---

_[View the full topic](https://forum.elixirforum.com/t/persistent-term-for-static-assets-using-plug/34295)._
