Closed Gitoffthelawn closed 4 months ago
Thanks for the heads up @Gitoffthelawn, that behavior came back when I migrated from Google Fonts to Fontsource.
It will be improved very soon. In the next update (spoiler) the settings menu will only load on a user action (/spoiler). Which means Bonjourr will never need to fetch fonts unless you go in the settings.
Also your browser is almost never making an actual request because api.bonjourr.fr/fonts is cached for a month and is immutable. I'm using fetch because it is really convenient, but if the cache is set correctly, it's almost behaving like a local storage !
@victrme You're welcome, and as always, thank you too!
In regards to the API call in the upcoming release when the settings menu is opened... how about only when the user places the focus in the Font family
input field?
In regards to making the actual requests in the current version, I don't employ much caching, so I'll double-check, but I think frequent calls are actually being made. But not a big deal, as you're about to change it anyways. :)
I added a call only on mouse hover as requested, everything was already there so it was easier than I thought.
I would argue that keeping some cache to avoid requesting assets every time is better for privacy! As long as cookies and session ids are cleared, the rest of the site data can stay. Might be wrong though.
Describe the bug Every time Bonjourr page is loaded, it makes a call to https://api.bonjourr.fr/fonts
To Reproduce Steps to reproduce the behavior:
about:newtab
Expected behavior Please only call https://api.bonjourr.fr/fonts if and when the data from that API is actually needed. If the user is only using local fonts with Bonjourr, calls to https://api.bonjourr.fr/fonts are never needed and thus should never occur. This will reduce your server's traffic, improve Bonjourr's performance, and improve privacy.
Device: