cameronterry / dark-matter

A highly opinionated domain mapping plugin for WordPress Networks
Other
12 stars 2 forks source link

Browser / no cache headers for SSO flow #40

Closed cameronterry closed 4 years ago

cameronterry commented 4 years ago

A recent setup which uses an AWS CloudFront in front of WordPress has noticed that the cache headers - Cache-Control / Expires - is not always present on some requests / URLs related to the SSO flow.

This PR ensures that the headers are present and adheres to how WordPress issues the headers, by utilising the wp_get_nocache_headers() (Doc Ref) function. It doesn't use the nocache_headers() function in case we need to add additional headers specifically for Dark Matter support in the future.

In addition, the redirects have been updated to ensure that the X-Redirect-By header value is for Dark Matter and not WordPress.