My WordPress Settings

This page shows details of my WordPress setup in order to get perfect performance.

For security reasons, some settings/plugins will not be disclosed.


My servers are fully dockerized, so your deployment case may vary.


A long-term Cloudflare customer.

Docker Images

Proxycustom-built caddy server. Caddy can automatically obtain SSL certificates, provide HTTP/2 and many more features than NGINX and Apache.
Databasemariadb. Believe it or not, MariaDB is faster than MySQL on my server.

Caddy Configuration

:443 {
    ... # some private config
    ... # proxy settings

    # Remove unnecessary headers
    header {
        ... # some private config

    # Rewrite images to webp
    @acceptsWebp {
        header Accept *image/webp*
	    path_regexp webp ^(.+)\.(jpg|jpeg|png)$
    handle @acceptsWebp {
        try_files {re.webp.1}.{re.webp.2}.webp {re.webp.1}.{re.webp.2}

    # Bloack some accesses
    @forbidden {
        path /xmlrpc.php
        path *.sql
        ... # some private config
    respond @forbidden 404

PHP Rewrite

This upload.ini removes the PHP upload settings defined in the image, which is annoying.

Map location: upload.ini:/usr/local/etc/php/conf.d/uploads.ini

file_uploads = On
memory_limit = ???M
upload_max_filesize = ???M
post_max_size = ???M
max_execution_time = ???

WordPress Plugins

AutoptimizeTried a lot, only this one can provide the best optimization performance for my case. Many others even slow down the loading speed
Code SnippetsAdd PHP code snippets without changing PHP files.
Disable CommentsSometime I need silence.
EWWW Image OptimizerImage optimizer and webp converter.
LuckyWP Table of ContentsThe best table of contents plugin I can find. No stupid JQuery, no stupid premium, no stupid CSS. FREE!!!
PrismaticSyntax hightlighter, even though sometime it is not working as you can see above 😔
Remove jQuery MigrateGET OUT OF MY SITE.
Simple Local AvatarsNo third-party Gravatar.
WP StatisticsNo Google Analytics.


With all these optimizations, this post page and the index page get both A on GTmetrix. Details can be found here and here.

Categorized as Server

By halyul

Never be a dreamer.

Leave a comment

Your email address will not be published.