FlyingPress generates static cached HTML pages to maximize performance. These pages are served directly by the web server (like Apache or Nginx), completely bypassing PHP execution.
As a result, any plugin or custom PHP code that expects to run on every request—such as those adding HTTP headers or redirection logic—will not work when a cached page is served.
Why this happens
Cached pages are served without loading PHP or WordPress.
This avoids unnecessary processing and improves performance.
But PHP-based logic like
header()
orwp_redirect()
won’t be triggered.
Affected use cases
Redirections added via
functions.php
or pluginsSecurity headers added using PHP
Plugins like Really Simple SSL, which add headers or redirect to HTTPS using PHP logic
Note: These plugins still work for uncached requests or in the admin area. The limitation applies only to cached pages served as static files.
What to do instead
If you need headers or redirects to work consistently, apply them at the server or CDN level:
1. Web server configuration
Add rules before FlyingPress cache logic:
Apache/LiteSpeed (.htaccess)
Header always set Strict-Transport-Security "max-age=31536000"
Redirect 301 /old-page /new-pageNginx
add_header Strict-Transport-Security "max-age=31536000";
rewrite ^/old-page$ /new-page permanent;
2. CDN (e.g., Cloudflare)
Use your CDN to:
Add HTTP security headers
Set up redirection rules
Apply geolocation or device-based routing