Trailing slashes actually serve an important purpose in URLs - they indicate you’re requesting a directory rather than a file, which affects how servers route reqeusts and can impact caching, redirects, and SEO.
Comment on Self host Blorp, your personal Lemmy/PieFed frontend
Zwiebel@feddit.org 1 day agoAren’t trailing slashes completely useless?
MysteriousSophon21@lemmy.world 1 day ago
shnizmuffin@lemmy.inbutts.lol 1 day ago
No, not at all.
They are a shorthand for “give me the index of this directory” rather than “give me the first file you find named this.” In some configurations, the presence of absence of a trailing slash dramatically reduces the amount of computation an HTTP server must execute before responding to the request.
moseschrute@lemmy.world 1 day ago
Unpkg.com shows different results based on trailing /