betagouv / pad.numerique.gouv.fr

Pad numérique de l'état
https://pad.numerique.gouv.fr/
GNU Affero General Public License v3.0
6 stars 1 forks source link

⚡️(frontend) add minimum character requirement for spell checker requests #52

Closed lebaudantoine closed 3 months ago

lebaudantoine commented 3 months ago

After analyzing the logs, I noticed that approximately 10% of the requests were for texts less than 10 characters long. To improve performance and reduce unnecessary load on the spell checker server, a minimum character limit has been introduced.

I suggest setting this limit to a value between 5 and 10 characters. This range balances user experience while effectively reducing server load.

This feature can be easily deactivated by setting the corresponding environment variable to 0.

I would be interested in one of your careful review @manuhabitela ❤️

It's deployed in staging if you want to test it. You can inspect the network, to make sure no request is triggered under 10 char.

https://github.com/betagouv/pad.numerique.gouv.fr/assets/45729124/f444c293-b31d-4fe6-9193-7a90116d35e4