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:

Pagespeed

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.

Google Search

Baidu Search

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 .

Google Search Console

For Baidu, you can submit links through the Baidu Resource Platform .

Baidu Link Submission

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:

Google Search Post Submit

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.

  1. Register a Cloudflare account, add a site, and choose the Free plan.

    Cloudflare add site

  2. Get the Cloudflare name server address.

    Cloudflare change name server

  3. Configure the name server according to the domain name registration site. The following figure shows the configuration for Google Domain.

    Google domain change name server

  4. After the name server migration, we can configure DNS resolution in Cloudflare. Be sure to select the Proxied mode.

    Cloudflare DNS Config

  5. Confirm the SSL/TLS configuration. Since our site itself has Caddyserver providing HTTPS, we can choose the Full mode here.

    Cloudflare SSL/TLS Config

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.