GridPane Caching Headers and Custom Compiled Nginx

Tags
gridpanecachenginx
Created
Jan 5, 2023 5:38 PM
Status
Done
image

Introduction

There was a Facebook post about the WordPress health check not detecting the GridPane server side caching. So I dug into this further.

WordPress Approved Cache Headers

This piece of code has the approve cache headers that WordPress considers valid https://developer.wordpress.org/reference/classes/wp_site_health/get_page_cache_headers/

GridePane Server Headers

The following are the GridPane server headers that are added.

server: Prometheus
pre-cognitive-push: Enabled
quantum-flux-capacity: Omega
x-grid-srcache-ttl: 2592000
x-grid-srcache-fetch: MISS
x-grid-srcache-store: BYPASS

The only header that is configured via Nginx config is the “server:” header, the other headers are set by the GridPane custom compiled Nginx.

root@test02-nginx-testingsrv-net:/etc/nginx# apt-cache show gridpane-nginx
Package: gridpane-nginx
Version: 1.16.1
License: unknown
Vendor: root@compile-prometheus
Architecture: amd64
Maintainer: Jeff Cleverley

[jeff@gridpane.com](mailto:jeff@gridpane.com)

Installed-Size: 257579
Depends: iproute2, libpcre3, libssl1.1, zlib1g
Conflicts: nginx-full, nginx-common
Build-Depends: build-essential
Provides: nginx-full, nginx-common
Replaces: nginx-full, nginx-common
Homepage:

[https://gridpane.com/](https://gridpane.com/)

Priority: extra
Section: httpd
Filename: pool/main/g/gridpane-nginx/gridpane-nginx_1.16.1_amd64.deb
Size: 63235494
SHA256: 3a544cccedbecb4edde24e97054e1ded7b5f9ae97cb94c1e207c316b7209cc38
SHA1: f827925ccd1907aa8b6673014c8b4554e1a5b893
MD5sum: 3a746447d8dc0791dd06d8d13af1766f
Description: GridPane Nginx - a high performance web server and reverse proxy for extremely performant WordPress sites.
Description-md5: 65aadbeeb5bd9851b71dc9a804c1eead

Running strings on the nginx binary returns nothing, however it’s possible that one of these modules contains the custom headers.

/etc/nginx/modules/ngx_http_set_misc_module.so
/etc/nginx/modules/ngx_http_geoip2_module.so
/etc/nginx/modules/ngx_http_echo_module.so
/etc/nginx/modules/ngx_http_redis_module.so
/etc/nginx/modules/ngx_http_srcache_filter_module.so
/etc/nginx/modules/ngx_stream_geoip2_module.so
/etc/nginx/modules/ngx_http_memc_module.so
/etc/nginx/modules/ngx_stream_module.so
/etc/nginx/modules/ngx_http_modsecurity_module.so
/etc/nginx/modules/ndk_http_module.so
/etc/nginx/modules/ngx_http_xslt_filter_module.so
/etc/nginx/modules/ngx_http_image_filter_module.so
/etc/nginx/modules/ngx_http_headers_more_filter_module.so
/etc/nginx/modules/ngx_http_redis2_module.so

List of all GridPane Sites on Nginx

Due to the custom headers implemented by GridPane, this has allowed indexing of GridPane Nginx sites. Here is a list.

CORRECTION - I’m incorrect!

Upon looking at the GridPane stack and grep’ing through the configuration. I left off the -i switch from grep. What does this do?

-i, --ignore-case         ignore case distinctions

If you search for any of the headers above, you will see they’re in the configuration.

Potential Solutions

1 - WordPress Hook

Max, a GridPane customer created a hook to fix this issue

2 - Set Custom Header

GridPane let’s you set custom headers, however, this is not ideal. If you disable caching, then you will still pass the health check. But if it’s super annoying to you then you can set a header site or server wide.

3 - Petition GridPane to use a supported cache header

Reach out to GridPane and have them use a supported cache header.