Tips: Reduce First Page Loading Time After git-deploy

18 sec read

Add the curl -v -sS http://example.com 2>&1 >/dev/null | grep '>' | cut -c1-2 --complement to deploy/restart. It will hit the server just after deployment so that your page all set to serve the first visitor after deployment without waiting for server to prepare at first.

When you try curl -v -sS http://example.com 2>&1 >/dev/null | grep '>' | cut -c1-2 --complement the server will respond like
remote: GET / HTTP/1.1
remote: User-Agent: curl/7.38.0
remote: Host: example.com
remote: Accept: */*

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *