DEV Community

Meat Boy
Meat Boy

Posted on

What is the best performance tweak for server/frontend side of application you made?

Like in the title, what are your tips for optimizing frontend/backend? Minimization of files, indexes on db, cache everywhere and ...? ;)

Oldest comments (3)

sannajammeh profile image
Sanna Jammeh • Edited

For Firebase, if you haven't updated to V9 already. Lazy import not commonly used packages for example realtime-database and shave 50-100kb off your bundle size. And upgrade to V9 already! πŸ˜…

For React specifically. When making requests, abandon useEffect+ fetch and install SWR. Saves you a ton of hassle both in DX and UX. Caches requests for you leaving a single hook acting as a global data store for that request. Also use optimistic updates with SWR mutate to update the UI before you've sent a request to change or create.

jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

Removing React

meatboy profile image
Meat Boy