EssamWisam / cmp-docs

A comprehensive guide for prospective, current and past students in the computer engineering department of Cairo university.
https://cmp-docs.pages.dev
52 stars 8 forks source link

🚚 Migrate deployment to Vercel #38

Closed EssamWisam closed 5 months ago

EssamWisam commented 5 months ago

Availability is a serious concern with the current deployment on Netlify servers when requests are sent from Egypt (and maybe other countries). I remember facing this issue in another project and potentially, migrating to Vercel/CloudFlare solved it.

EssamWisam commented 5 months ago

Done. The new domain is cmp-docs.vercel.app

I haven't experimented with this enough but if it proves to be more available than Netlify (hopefully it will), we can forget about the other domain and even upgrade the Vercel one into a standard .com domain.

EssamWisam commented 5 months ago

Question: I am not the only one to experience low availibility sometimes for the site hosted on Netlify, right? That is, sometimes it would just never load.

Iten-No-404 commented 5 months ago

Question: I am not the only one to experience low availibility sometimes for the site hosted on Netlify, right? That is, sometimes it would just never load.

I don't open it quite often but when I do, it loads perfectly fine. Are you perhaps using a VPN?

EssamWisam commented 5 months ago

Not using a VPN but a vivid memory of mine is that after I deployed it more than three months ago, it would sometimes just never load unless I refresh many times. Back then I blamed it on Neltlify servers but later I traveled and didn't face the problem so I decided to blame it on Netlify and Egyptian client machines. Now given what you said I maybe have to be precise and blame it on Vodafone client machines.

Iten-No-404 commented 5 months ago

Now given what you said I maybe have to be precise and blame it on Vodafone client machines.

Maybe, I use Etisalat. It could also be that the area you live in doesn't have good coverage by Vodafone.

it would sometimes just never load unless I refresh many times.

Does that happen frequently nowadays?

EssamWisam commented 5 months ago

Frequently: not really. But did it happen: absolutely yes.

I have doubts that it was due to the ssl thing as well. The original solution wasn't really clean. I think it could be really this because another React project I deployed didn't have that ssl problem and worked good on all Netlify, Vercel and Cloudflare.

EssamWisam commented 5 months ago

You mentioned noticing a slowdown in image loading for Vercel compared to Netlify. How does Cloudflare compete here? I like it the most because it makes it easier to attach security and analytics stuff and has a nicer domain (although I was willing to upgrade to .com anyway which I know found is unavailable).

EssamWisam commented 5 months ago

I assume you didn't have time to try. That's okay for me I am not experiencing such difference between the three. I think I'll let Cloudflare be the default since it has the coolest domain name and presumably is more secure.

Iten-No-404 commented 5 months ago

You mentioned noticing a slowdown in image loading for Vercel compared to Netlify. How does Cloudflare compete here?

I assume you didn't have time to try.

Yes, I have been out all day today since the early morning. I don't have a laptop right now but I can try them out on the phone and at the end of the day I can test the speeds more throughly on the laptop.

I think I'll let Cloudflare be the default since it has the coolest domain name.

If I am not mistaken, this cmp-docs.pages.dev is the domain for Cloudflare, correct? It is pretty cool indeed. It should also be added to the repo description and the README.

EssamWisam commented 5 months ago

No worries regarding the comparison. Do it at your leisure if you feel like doing it ever. Yes, it is cmp-docs.pages.dev and the repo description and README were updated to reflect that.

Iten-No-404 commented 4 months ago

Yes, it is cmp-docs.pages.dev and the repo description and README were updated to reflect that.

Great.

No worries regarding the comparison. Do it at your leisure if you feel like doing it ever.

I tried a couple of times in each deployment. My methodology was pretty simple: Paste the address of the deployment in a new incognito window and as I press enter, I also click Start on my phone's stopwatch. And I also make sure that the link is not opened in any other window beforehand. I halt the stopwatch when all the text in the home page has loaded regardless of the images being fully loaded or not.

When I'd switch to the classes pages from the About page, the images would load in ~2 seconds or less, and is almost consistent in all 3. Almost every time in each deployment, the white circles bug occurs in the bottom half.

On the other hand, the time for the initial load of the website as a whole differs when I first enter the link. Below is a few trials done and approximated in seconds:

On Sunday:

Netlify Vercel CloudFlare
~4 ~2 ~2
~3.5 ~3 ~3
~4 ~4 ~2.5
Today: Netlify Vercel CloudFlare
~3.5 ~4 ~4
~4 ~3 ~2.5
~3.5 ~3 ~2.5

So, it's apparent that Netlify is the most consistent one in duration, Vercel is the one with the most variation and CloudFlare is generally the fastest overall. Since this is based on merely 2 different times, it shouldn't be completely trustworthy but it gives a general idea of where each deployment stands in terms of speed.

EssamWisam commented 4 months ago

Genuinely impressed with this effort. Thanks a lot! Quite exceptional as usual.