robinvdvleuten
Cache manifest path in Umbrella Phoenix application
I’ve created a Phoenix Umbrella project containing two applications. They will both be served as separate endpoints. To share assets between them, I’ve created a new application called “assets”, which sole purpose is to have the “/priv/static” directory. Now I would like to share the assets with both endpoints, and I already configured the static plug for that;
plug Plug.Static,
at: "/",
from: :example_assets,
gzip: true,
only: ~w(css fonts images js favicon.ico robots.txt)
This works perfect in development. But when I build and start an release of one the endpoints, I run into the following error;
[error] Could not find static manifest at "/app/example_web/lib/example_web-0.1.0/priv/static/cache_manifest.json". Run "mix phx.digest" after building your static files or remove the configuration from "config/prod.exs".
How do I make my “example_web” endpoint aware of the cache manifest file in the “example_assets” directory? Thanks in advance for any help!
First Post!
LostKobrakai
I guess the cache manifest doesn’t yet support static assets in another application:
https://github.com/phoenixframework/phoenix/blob/3e1257c499ed51a67b072d73bf9b0397f68476dd/lib/phoenix/endpoint/supervisor.ex#L453-L467
You cannot use relative paths without Application.app_dir as mix and releases use different folder structures.
Last Post!
robinvdvleuten
You’re correct, it is indeed not possible to forward any requests to another endpoint. I’ve created a PR in the Phoenix project to allow cache manifests from different apps (Load cache manifest from specified application by robinvdvleuten · Pull Request #3618 · phoenixframework/phoenix · GitHub).
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










