F
Filament15mo ago
Alex

`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:
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....
Jump to solution
63 Replies
Thijmen
Thijmen15mo ago
Bump so one of the maintainers sees it
Vp
Vp15mo ago
If you want in docs then you can make a PR to github
Thijmen
Thijmen15mo ago
Yeah well he asked if there was a reason it wasn't in the docs
Thijmen
Thijmen15mo ago
Yeah that doesnt help at all
harps
harps15mo ago
I'm also looking at how caching should be implemented but this must be a wider topic on caching in Laravel not just filament.
toeknee
toeknee15mo ago
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
awcodes
awcodes15mo ago
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.
toeknee
toeknee15mo ago
I suppose we could add common Perfromance tips, like ensuring array data is loaded in via functions, icons are cached etc
awcodes
awcodes15mo ago
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.
toeknee
toeknee15mo ago
Yeah I agree
Intel
Intel15mo ago
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
Alex
AlexOP15mo ago
It certainly seems hardware dependant. But a “Deploying to production” section that explains caching and/or other improvements could help greatly.
Intel
Intel15mo ago
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
awcodes
awcodes15mo ago
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.
Intel
Intel15mo ago
The moment you decided to depend on it it became a filament thing 🤦‍♂️
Alex
AlexOP15mo ago
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?
awcodes
awcodes15mo ago
That's fair. But we also shouldn't tell you to do something that isn't necessary for the operation of Filament.
Intel
Intel15mo ago
it's necessary for production though. I spend a good few hours profiling before I realised which package was causing the slow down
Alex
AlexOP15mo ago
You can structure it the same as laravel in their section explaining config caching for example. Not required but certainly beneficial.
awcodes
awcodes15mo ago
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. 🤷‍♂️
Intel
Intel15mo ago
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.
awcodes
awcodes15mo ago
I totally get that
Intel
Intel15mo ago
I'm removing filament next week because it's clearly just a hobby project at this point and not meant for production
toeknee
toeknee15mo ago
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.
awcodes
awcodes15mo ago
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.
Intel
Intel15mo ago
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
toeknee
toeknee15mo ago
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.
Intel
Intel15mo ago
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
toeknee
toeknee15mo ago
As do the majorty of packages.
Intel
Intel15mo ago
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?
awcodes
awcodes15mo ago
"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.
Intel
Intel15mo ago
it's probably every server that doesn't have NVME. and even if it's fast enough for you it could be faster
toeknee
toeknee15mo ago
It runs perfectly out of the box, if you are scaling you need to apply all standard performance improvements for your used packages.
awcodes
awcodes15mo ago
But, i wish you well with your project and I thank you for giving Filament a try. Cheers.
Intel
Intel15mo ago
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
toeknee
toeknee15mo ago
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.
Intel
Intel15mo ago
I'm not asking for dev. I'm asking for a simple note in a section deploying to production or whatever
awcodes
awcodes15mo ago
so PR it already.
toeknee
toeknee15mo ago
Which we have said numerous times to just make a PR and include it?
Intel
Intel15mo ago
sure, so we agree it would be a good addition to the docs?
awcodes
awcodes15mo ago
I will also say that on $5 DO droplet with no optimization I was still getting sub 50ms responses with filament.
toeknee
toeknee15mo ago
Same
Intel
Intel15mo ago
without caching the icons?
awcodes
awcodes15mo ago
yes
toeknee
toeknee15mo ago
Yep
Intel
Intel15mo ago
interesting because that's not what happened for me yesterday
awcodes
awcodes15mo ago
honestly, between our production sites with caching and our staging without caching, I getting pretty much the same response times.
Thijmen
Thijmen15mo ago
I tested it yesterday and had some remarkable faster times with icons cache. (Hetzner server)
cheesegrits
cheesegrits15mo ago
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
cheesegrits
cheesegrits15mo ago
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
awcodes
awcodes15mo ago
Thank you @cheesegrits.
Log1x
Log1x15mo ago
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 ⚡
awcodes
awcodes15mo ago
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.
Log1x
Log1x15mo ago
open source can be a cesspool 🙂 full of entitlement
awcodes
awcodes15mo ago
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.
Intel
Intel15mo ago
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 🤣
cheesegrits
cheesegrits15mo ago
As I said, I wish you all the best. Have a day!
Intel
Intel15mo ago
Cope Leaving this "community". Have fun with the hobbyproject 🤓
Log1x
Log1x15mo ago
someone forgot to take their meds
Intel
Intel15mo ago
Least toxic filament dev
toeknee
toeknee15mo ago
Great work on the PR Hugh Sorry what's not stable about v3?
Solution
cheesegrits
cheesegrits15mo ago
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.
Want results from more Discord servers?
Add your server