-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to CloudFlare? #69
Comments
Just looked a bit into it, looks reasonable. Will give it a try soon! |
@fkling Let me know should you have any questions 😉 |
Ah right, you work there 😄 |
Guilty 😄 But this is definitely not something I'm paid for, just really think it's a good idea - we have relatively big yet separate bundles, and they can benefit from HTTP/2 a lot :) |
No worries, I trust you :) I just registered and enabled it... that was really easy! Now I just need to wait for the nameserver to update. Given that the JS files are now cached, I think we have to configure webpack to add hashes to the bundle files, and somehow update |
@fkling Just so that we don't wait later - did you enable HTTPS, HSTS and HTTP/2? |
Seem to be enabled by default, except HSTS. Is it worth enabling for us though? |
Nameservers are now active btw. Can't really test it though since the DNS entries seem to be cached somewhere between my computer and the nameserver ;) |
Ah cool. I don't know, maybe not, but in practice way too many Wi-Fis at cafes tend to insert own banners or tracking codes when website is sent over HTTP connection, so better to have HTTPSed everything possible. |
Hmm, my nslookup already returns CloudFlare IPs after DNS flush, but seems to be still sent over HTTP. |
Ah right I was still visiting HTTP version and HTTP/2 works only over secure connections (one more reason to enforce it ;) ). It works! |
Ah right, we don't benefit that much because our bundles are not loaded in parallel and |
So this was all for nothing? :P |
The Parse SDK loads fast for me, but sure, I can try serving it from here. I need to update it anyway. |
There are some more points I can think of in terms of performance, will probably play with it somewhat later. |
👍 |
Haha, did this locally, too!
I always enable 3G throttling for network perf tests in order to be sure it's not just my internet speed, but yeah, looks much faster to me even in such mode, great! Same for me, great! I always try to enable 3G/4G throttling for testing in order not to depend on own internet speed, but it's still great. |
@fkling One more suggestion: split vendor code (React + CodeMirror at least - they take most of the size) and app code itself. This will allow both to parallelize their download, and improve caching, as React and CodeMirror update much more rarely than code of ASTExplorer itself, so user will get much smaller diffs. |
OK, I did that, but not sure I did everything correctly :P |
@fkling Me too :D Can probably check generated |
Looks good to me, DOMContentLoaded reduced from 6s to 4s on 3G throttling without cache \o/ |
Note that this graph represents CDN cache results to original server responses, and doesn't say anything about browser cache. However, I did look at headers of requests/responses with caching enabled, and it looks like HTML is the only one that doesn't get |
One more thing - you probably want to increase timing, as |
And one more - the graph you show here is graph of # of requests, not actual bandwidth - that is, it counts HTML as 1 request, one JS file as another, and so on despite they have different size and thus impact. What does Bandwidth tab show? |
If you see As for 304 - this is the response that goes back to your browser so that it would know something wasn't changed and local copy can be used, however original server still gets hit by each separate user requesting it, and not cached by CDN for all users at once. When many users visit astexplorer.net for the first time (e.g. from tweets) or after 10 sec they will all hit the server fully for this file, and if they visit second time, they hit it to know the status, but anyway hit happens for each separate request. As for the bandwidth - I guess you're right that |
Btw, on my blog, for example, numbers are following: Total Requests: 1,249 which is pretty normal for website that is not very popular and most users come from search / tweets / profiles / whatever and thus not cached for long. |
@fkling Would you be interested in putting astexplorer.net behind CloudFlare? Free plan should work perfectly, and will give HTTPS, HTTP/2 + SPDY and CDN out of the box which should speed up loading our bundles for users.
The text was updated successfully, but these errors were encountered: