Testing Website Speed
After deploying our static blog site, we can use the testing tool provided by Google to detect the performance of the website: https://pagespeed.web.dev/
The test result is as follows:
Common optimization directions include enabling compression, compressing and merging JS/CSS resources, and postponing JS loading. Overall, the performance of the static site generated by Hugo is quite good.
Search Engine Inclusion
After our blog site goes online, if we want it to be searchable, we can submit it to search engines. In the long term, we can also do SEO (Search Engine Optimization).
To verify if our website has been indexed by search engines, we can search for site:tomo.dev
in the search engine.
As you can see, our site has not been indexed by search engines. At this point, we can manually submit the site to the search engine for indexing.
For Google, you can submit through Search Console .
For Baidu, you can submit links through the Baidu Resource Platform .
Generally, after submission, it will be indexed by search engines within 1-2 days. Searching for site:tomo.dev
again will show the search results:
Cloudflare
Cloudflare offers a free plan that can basically meet the daily needs of most individual users. To use Cloudflare’s CDN service, we need to migrate our domain name resolution to Cloudflare.
Register a Cloudflare account, add a site, and choose the Free plan.
Get the Cloudflare name server address.
Configure the name server according to the domain name registration site. The following figure shows the configuration for Google Domain.
After the name server migration, we can configure DNS resolution in Cloudflare. Be sure to select the Proxied mode.
Confirm the SSL/TLS configuration. Since our site itself has Caddyserver providing HTTPS, we can choose the Full mode here.
At this point, our site is cached by Cloudflare, which will speed up access for users from all over the world. The default cache policy of Cloudflare is 4 hours, which can be configured through Browser Cache TTL in the Caching menu.