Public routes can grind your Laravel app to a halt. See why and how to fix it!
A public “asset“ route is one created dynamically in your Laravel code base, but serves “static asset” such as an SVG or JS embed meant to be used by your users/customers.
However this means any traffic your customers get, you get (since they’re serving up YOUR asset on their site)!
There’s two ways this breaks Laravel:
1. Creating too many sessions
2. Overloading your server
We see what the session issue is, and 2 ways to fix it. Then we discuss what to do about overloaded servers.
The real danger is that when you create embeds or other assets that your users add to their site, their web traffic becomes your web traffic.
This create a session per your customer’s users, which results in your disk filling up (storage issues) or creating too many files (inode issues).
Of course, it can also overload your poor server with traffic it’s not meant to handle.
Here’s how to handle these scenarios.
⌚️ Timestamps
00:00 What’s a public route
00:18 How public routes break things
00:52 Session are dangerous
02:22 Sessions quick fix
04:44 Better session fix (custom routes)
06:21 Handling overloaded servers
11 views
27
4
23 hours ago 00:20:02 1
End-to-End Encryption (E2E) is Dead. Killed By New Tech.
1 day ago 00:46:36 1
Беседа в Дубне с доктором - специалистом по тёмной материи
1 day ago 00:10:47 1
China’s COMAC SHOCKS Boeing! 15 ARJ21 Planes Delivered in 6 Months, CHEAPER Than the C919 aircraft!
1 day ago 00:01:24 1
Journey Through Time - The Wild West and the Transcontinental Railroad (Part 1 of 4).