devnacho
Hi there! ![]()
For SEO purposes, I’m trying to improve loading performance by not having render blocking stylesheets and loading critical styles inside <style> tags directly in the HTML.
Does anybody have any idea or recommendation on how to put my webpack-processed stylesheet inside <style> tags in the HTML layout.
Any help would be really appreciated!
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Latest Phoenix Threads
Latest on Elixir Forum
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
You can read and output compiled
app.cssfile (or other target if you have one). This should work in development and in prod, also with Erlang releases. In your layout or template do:And it will output the compiled CSS in place, provided your compiled file ends up in
priv/css/app.cssand that your application name is:ui. Replace these with your own if neededidi527
Is it read once during compilation or every time the template is invoked / rendered?
devnacho
I’m exploring loading it as Module attributes so it isn’t read every time the template is invoked.
idi527
If you load the contents into a module attribute, it’s read from the filesystem only once during the compilation.
Oh, I misunderstood you. Ignore me.
I’d put it in a function instead of a module attribute though. This way you would be able to invoke it from other modules as well, not just within the module where you defined the module attribute.
and then in any template
hubertlepicki
Every time it is rendered. OS should keep it in cache if that file is being read over and over again, I would probably not bother too much with making it module attribute.
devnacho
Thanks for the replies.
I ended up getting the file from
priv/staticand I used GitHub - melpon/memoize: A method caching macro for elixir using CAS on ETS. · GitHub to memoize the contents of the file and avoid opening the file with each rendering of the template.