We have a site on WPEngine that uses WP Rocket cache and Cloudflare where I have added security header directives in the .htaccess
file,
<IfModule mod_headers.c>
# X-XSS-Protection
Header set X-XSS-Protection "1; mode=block"
# X-Content-Type nosniff
Header set X-Content-Type-Options nosniff
# Content-Security-Policy
Header set Content-Security-Policy "default-src https:; font-src https: data:; img-src https: data:; script-src https:; style-src https:;"
# Strict-Transport-Security
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=84600, public"
</filesMatch>
</IfModule>
This was added a week ago and I have clear all the caches twice since then, but still on securityheaders.com the site receives an 'F'. What can be done to make these security headers take effect?