The HTTP Strict Transport Security (HSTS) response header, Strict-Transport-Security
, is not the same as the Link
response header shown in the screenshot you’ve provided. These are completely different response headers that are unrelated. Please review these response headers in great detail to get an understanding on what they mean and how they differ.
The review you’ve referenced is not related to what you’re discussing as that is referring to linking to a post with the applicable shortlink (e.g. https://www.example.com/?p=158
redirects to https://www.example.com/some-post/
). This is now supported so that review is no longer applicable to the current version of Cache Enabler:
curl -s -D - -o /dev/null https://www.example.com/?p=158
HTTP/2 301
server: nginx/1.17.10
date: Thu, 24 Dec 2020 17:12:42 GMT
content-type: text/html; charset=UTF-8
location: https://www.example.com/some-post/
x-powered-by: PHP/7.4.8
x-pingback: https://www.example.com/xmlrpc.php
x-redirect-by: WordPress
curl -s -D - -o /dev/null https://www.example.com/some-post/
HTTP/2 200
server: nginx/1.17.10
date: Thu, 24 Dec 2020 17:13:23 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-powered-by: PHP/7.4.8
x-cache-handler: cache-enabler-engine
Yes, the Link
response header value may contain a shortlink, but that is not what that referenced review was discussing. When that review was written I believe the shortlink wouldn’t redirect, but am uncertain as I’m not going to replicate the issue for the sake of this reply as it’s not applicable.
I may have misunderstood what you were referring to in your first response due to the lack of clarity and misused terms, however, my same response still applies. We don’t modify any response headers other than currently adding the X-Cache-Handler
response header. That means if a plugin, or even the WordPress core itself, adds any response headers after the advanced-cache.php
drop-in they won’t be added as once a cached page is delivered the response is completed. As far as I’m aware WordPress would set any Link
response headers, like what you’ve underlined, in the send_headers
hook. This comes much later than when Cache Enabler delivers the cached page, so yes the Link
response header(s) set by WordPress won’t be on the cached page delivered by Cache Enabler. (If the advanced configuration is implemented WordPress itself is completely bypassed.) We have no plans to deliver a cached page later because we purposely do it as early as we are able because it dramatically increases the speed of a cached page being delivered.
What you’ve underlined in your screenshot is simply for WordPress REST API discovery. Again, this is not related to HSTS. This is a value set by WordPress in the Link
response header (wp-includes/rest-api.php
). As far as I’m aware, it’s not necessary unless you have a client that needs to discover this through the response headers. (This is also set in the HTML itself if a client parses the HTML instead.) As for the Link
response header values that come afterwards those serve no purpose other than providing a shorter link to redirect to the actual post. That means in most cases the default Link
response header(s) set by WordPress are not required, which is why you’re the first that I know of that has brought this topic up.
All of the above still means that for any desired response header to be set on a cached page being delivered by Cache Enabler can be set in your server configuration file. This is in your complete control.