document id as pathname
So I'm using the document ID as a pathname, which is making url ugly and too long is there any alternate approach that I can use?
So it's like for example -> abc/[document_id] and when someone goes to abc/[document_id] through the document id I am getting the info to show it on the page.
Can someone please suggest an alternative approach to this thanks
4 Replies
You can make your own ids that are shorter or prettier, like an incrementing number or a short string. Add an index on the new id for fast lookup.
will that be as fast as db.get ?
Yes, under the hood db.get is just an indexed query
Thanks @lee