`php artisan icons:cache` required but not documented?
I have been scratching my had on a pretty serieus performance issue and I just noticed that one of the packages Filamant requires needs some caching to be done.
Am I completely blind or is this documented (searched on github and v2/v3 docs sites) somewhere because I feel like there should be a big section dedicated to telling people to do that...
In addition it does pop up from time to time here in Discord and in issues/discussion but nowhere in the docs, what gives?
Solution:Jump to solution
The PR got merged, btw, so next time the doc site gets rebuilt it should clearly state in the "Deploying to production" section that you may wish to cache icons.
If the OP could mark this as the accepted solution, that might help anyone else searching for this.
So that's all wrapped up, we cna move on with our lives. Happy Monday, everyone....
63 Replies
Bump so one of the maintainers sees it
If you want in docs then you can make a PR to github
Yeah well he asked if there was a reason it wasn't in the docs
Yeah that doesnt help at all
I'm also looking at how caching should be implemented but this must be a wider topic on caching in Laravel not just filament.
Just saw, php artisan icons:cache is just normal these days. But feel free to make a PR to the docs explaining for production to ensure the icons is cached
It's not in the docs, first, because where would it even go. :), but secondly because it is not a requirement to run filament. I've never even had to cache them and filament hasn't slowed down for me at all. The only time it has slowed down for me was a result of debugbar's view collector.
I suppose we could add common Perfromance tips, like ensuring array data is loaded in via functions, icons are cached etc
Possibly, wonder if a FAQ section would be better, to kinda wrangle together some common questions into one place.
i see a lot of the same exact questions in this channel. might help to cut down on that.
Yeah I agree
The installation maybe? Since posting about this in a local community discord I’ve seen 4 people who were affected by this already. And they were definitely not aware that filament/the icon package was slowing their site down
It certainly seems hardware dependant. But a “Deploying to production” section that explains caching and/or other improvements could help greatly.
To me it seems ridiculous to accept this risk. It’s unrealistic to expect people to check every dependency you decide to throw in your library. So if one of the libraries you depend on says to cache the icons you should at least relay that information
I don't, it's really a Blade Icons thing and not a Filament thing. But I can see the confusion. Blade Icons even mentions it in their readme: https://github.com/blade-ui-kit/blade-icons#caching, and the Filament Docs makes it clear that the package is being used: https://filamentphp.com/docs/3.x/support/icons
GitHub
GitHub - blade-ui-kit/blade-icons: A package to easily make use of ...
A package to easily make use of SVG icons in your Laravel Blade views. - GitHub - blade-ui-kit/blade-icons: A package to easily make use of SVG icons in your Laravel Blade views.
The moment you decided to depend on it it became a filament thing 🤦♂️
But how are we supposed to guess that package is even installed? It’s a direct requirement of filament. You can’t expect users to comb through the docs of every package filament depends on right?
That's fair.
But we also shouldn't tell you to do something that isn't necessary for the operation of Filament.
it's necessary for production though. I spend a good few hours profiling before I realised which package was causing the slow down
You can structure it the same as laravel in their section explaining config caching for example. Not required but certainly beneficial.
I'm not disagreeing, just saying that it is something that is a per case issue and should be handled as needed.
i'm running a site just fine in production without caching them. 🤷♂️
dude...
the best practice is 100% caching these icons, even if YOUR website is running fine it doesn't mean that other websites are running fine.
I totally get that
I'm removing filament next week because it's clearly just a hobby project at this point and not meant for production
It's a hobby project because we didn't tell you all possible steps of all the possible packages? You could simply make a PR to inform users you need to cache for performance.
Sorry to hear that. It's certainly not a hobby project. And it's shame that you think so because you had to cache some icons.
you're dragging these packages in. do I have time to go through all the docs of all those packages? I don't think so
caching the icons is not the issue. the lack of documentation regarding that on your side is
You absolutely should be checking all packages that you are using. The team vet all the packages and use them, to us its common, to you it's not. We have missed informing people on that, but 2 seconds on search shows you it.
then that is an excellent reason to throw filament out the window then. Because Filament is depending on quite a lot of 3rd party stuff. If you don't consider it your responsibility to inform people about best practices about the packages you decide and even know about to require then that shows lack of taking responsibility to me
As do the majorty of packages.
yes and when there's additional configuration required for them to run properly. I expect to find it in the documentation of said package requiring whatever 3rd party package
I really don't understand why this is even a discussion?
"yes and when there's additional configuration required for them to run properly."
and this is the point. it is not required to run properly. it just happens to be required to run on your specific setup / server.
it's probably every server that doesn't have NVME. and even if it's fast enough for you it could be faster
It runs perfectly out of the box, if you are scaling you need to apply all standard performance improvements for your used packages.
But, i wish you well with your project and I thank you for giving Filament a try. Cheers.
I wasn't scaling. my testing yesterday was a basic DO droplet with a plain laravel install and requiring filament. it went from 50ms to 500ms after installing filament. thats problematic
IT could be, but if people want to cache on local in dev, then you need to recache each time and that's a ton of support requests asking why icons are not working.
I'm not asking for dev. I'm asking for a simple note in a section deploying to production or whatever
so PR it already.
Which we have said numerous times to just make a PR and include it?
sure, so we agree it would be a good addition to the docs?
I will also say that on $5 DO droplet with no optimization I was still getting sub 50ms responses with filament.
Same
without caching the icons?
yes
Yep
interesting because that's not what happened for me yesterday
honestly, between our production sites with caching and our staging without caching, I getting pretty much the same response times.
I tested it yesterday and had some remarkable faster times with icons cache. (Hetzner server)
I submitted a PR to add some advice about caching icons in the "Deploying to production" section of the docs. Would seem to be the best solution rather than just arguing. 🙂
My personal experience is that with only the Heroicon set in use, I see no noticeable difference. But ymmv, so it's definitely a good recommendation to have in the docs.
https://github.com/filamentphp/filament/pull/8683
GitHub
Add advice about caching icons to Deploying section. by cheesegrits...
As per Discord support thread.
We're sorry we didn't meet your exacting standards for free, community supported software, and we wish you all the best in finding a more professional solution that meets your needs.
My one piece of advice is that when using open source software, if you find something missing in the documentation that you feel is important ... just PR it.
"Be the change you want to see in the world" - M. Ghandi
Thank you @cheesegrits.
for what it's worth, I have a filament dashboard with 50k software, 400k files, 1.5 million file versions, and like 100k threats and have blade icons literally plastered everywhere and completely forgot about ever thinking about caching it til this thread. i've had 0 performance issues and its on a $10 droplet. this site also has a full frontend that also uses blade icons so... ive never had to think about performance once. its always been ⚡
Personally had an issue with a version of one of my plugins show up today where a package was using a version of a package that was throwing errors in somebodies quality check about “illegal software” does that make me responsible? Especially if that package is open sourced.
And, for the record, it was not a small package and not specific to my plugin. It affects, the community at a larger scale if it’s really an issue.
open source can be a cesspool 🙂
full of entitlement
It can. I agree. But where is the liability of responsibility? That’s my question. Like if Laravel has a huge security hole am I responsible for using Laravel or is Laravel responsible.
I think that same mentality trickles down. And is the same from a principle standpoint.
Sure and I’m not one to complain about free stuff usually but in this case I think it’s unacceptable the installation of a package causes a lot of peoples websites to slow down by 400ms. Furthermore the maintainers don’t seem to care at all even though I’ve seen plenty of cases after reporting my findings to others. So for the record: my issue is not that I had the caching problem and spend time investigating, my issue is that the maintainers knew about it and didn’t care. Doesn’t make me trust this project at all
Ok but cache the icons and see the difference. My site was fast enough that nobody was complaining but I have performance monitoring so I saw that it dropped a ton after switching to filament
Anyways I’m throwing it out and switching back to nova. Have fun with your not so stable livewire3 release guys 🤣
As I said, I wish you all the best. Have a day!
Cope
Leaving this "community". Have fun with the hobbyproject 🤓
someone forgot to take their meds
Least toxic filament dev
Great work on the PR Hugh
Sorry what's not stable about v3?
Solution
The PR got merged, btw, so next time the doc site gets rebuilt it should clearly state in the "Deploying to production" section that you may wish to cache icons.
If the OP could mark this as the accepted solution, that might help anyone else searching for this.
So that's all wrapped up, we cna move on with our lives. Happy Monday, everyone.