144 likes
·
5.2K reads
11 comments
Very interesting read-up in how this is done.
Hey! I was about to comment regarding:
soon realized that Brave browser also blocks third-party cookies when privacy shield is on
but now it's handled! I use Brave and had to disable the Shield to able to comment on blog posts. Just verified and there's no need anymore.
Awesome work!
Good post, thank you :)
Via SSO in this way, Hashnode seems it doesn't benefit from SPA.
And I have some problem with Chrome History. When I go a blog post from main page, and I want to go back, URL changes to the root domain but the content is the blog post.
Is this problem special for me or general?
Hi Emin,
Thanks for the comment. SSO doesn’t take away benefits offered by SPA. If you visit any blog home and click on a post you will get a SPA experience. SSO only kicks in when you load the blog or any post for the first time.
And regarding the issue, it was a temporary glitch. Has been fixed now. :)
Hello again,
Today I noticed that medium.com uses same or similar solution for old custom domain blogs. But It has better feature, it only redirect at the first time opened the page. ( Probably, it stores credentials at cookies, and if cookies exist, pass this url query procedure )
But hashnode make it every refresh page.
I am not expert, I only watch network at chrome dev tools.
I have tested on emindeniz99.com hasnode blog ( click blog and about pages ) and hanakamer.com ( refresh(f5) page ) medium blog.
Medium blogs is faster than hashnode at this point. It can be improved.
What do you think about it?
Thanks for the platform.
Hey, I missed this somehow. Having lunch -- I'll get back soon. :)
Sandeep Panda :) Could you read my reply?
Emin Deniz Redirects on Hashnode are cheap and fast since it utilizes Cloudflare Workers. It can handle millions of redirects easily. That's the reason we choose to redirect every time without storing that info in cookies. This can be implemented, but then we also need to figure out a logout strategy -- what happens when someone logs out from Hashnode? Should we clear individual cookies from each domain or leave the cookies? This needs some thinking -- but since our redirects use edge caching it doesn't really matter at this time.
Static pages (e.g. /about) on Hashnode don't utilize edge caching currently -- that's why you might have felt that Medium is faster after setting cookies. We are pushing some changes this week which will improve performance of static pages.
If you check your blog home and individual blog posts, you will notice that Medium is never faster than us, even after storing SSO info in a cookie.
You can use this: developers.google.com/speed/pagespeed/insi… and lighthouse to measure.
Hope this answers your question. :)
Great post Sandeep . However I have a question. You still using login cookie to authenticate. Is it not blocked?
On individual blogs, we authenticate with a short lived JWT. :)
Hi! Sandeep Panda , this was very informative article. I am also curious to understand how you handle custom domains just by CNAME pointing to hashnode.network domain. Its very straightfoward compared to other platforms. May be you can share an overview of its architecture.