# Javascript in Phoenix templates

**URL:** <https://forum.elixirforum.com/t/javascript-in-phoenix-templates/22825>\
**Category:** Questions\
**Tags:** phoenix, eex, javascript, templates\
**Created:** [May 31, 2019, 12:44pm UTC](https://forum.elixirforum.com/t/javascript-in-phoenix-templates/22825 "2019-05-31T12:44:25Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [June 1, 2019, 9:29am UTC](https://forum.elixirforum.com/t/javascript-in-phoenix-templates/22825/8 "2019-06-01T09:29:43Z")

</div>

You are not “sending”, you only specify the resources source. The browser then chooses to cache or not to cache this resource and is free to not download it again in the future.

This way you can massively decrease the number of requests made to your server. Also a single large request is usually more effecient regarding the payload/header ratio than many small ones.

Of course you are totally free to use many entry points and separate your scripts that way you describe.

---

_[View the full topic](https://forum.elixirforum.com/t/javascript-in-phoenix-templates/22825)._
