How Freshy resolved false security scan results by implementing server-level headers

When a client’s website security scan reported missing headers and potential vulnerabilities, Freshy investigated and determined the issue was not with the site’s configuration, but rather with how caching affected the scan results. By migrating key security headers from the WordPress plugin layer to the server level, Freshy ensured consistent protection across all cached and dynamic requests—restoring the site’s “A+” rating in online security scans.

Issue background

The client received an urgent report from their hosting provider and security partner indicating several issues:

  • Missing clickjacking protection
  • Missing content type sniffing headers
  • Absent content security policies
  • No firewall connection
  • Possible domain spoofing concerns

At the same time, the client’s domain had recently experienced spoofed email activity, heightening their concern about overall security posture.

Freshy was asked to review the website’s configuration and confirm that appropriate headers, DNS protections, and malware safeguards were in place.

Diagnosis

Freshy began the review by running tests through securityheaders.com and confirming results using standard developer tools. Initial scans returned a “D” rating, showing missing headers such as:

X-Frame-Options
X-Content-Type-Options
Strict-Transport-Security
Content-Security-Policy

However, when developers appended a random query parameter to the URL (forcing a cache bypass), the results improved to an “A+” score—revealing that the headers were in fact present in uncached responses.

This led to the discovery that the site’s caching plugin, FlyingPress, was serving static pages directly without reattaching the security headers managed by WordPress plugins such as Headers Security Advanced & HSTS WP.

In short:

  • Cached (static) responses = headers missing
  • Uncached (dynamic) responses = headers present

The site itself was fully protected, but automated scanners flagged it as insecure when reading cached pages.

Resolution steps

To ensure full and consistent protection—both for users and external security scans—Freshy implemented a multi-step fix:

  1. Temporarily disabled caching
    This allowed a controlled environment for testing and verifying header behavior.
  2. Verified header presence on dynamic pages
    Using curl and browser developer tools, Freshy confirmed that the correct headers were being sent when the site was rendered dynamically by PHP.
  3. Moved headers to server-level configuration
    Freshy migrated the following headers to the site’s web server configuration, ensuring they applied to all responses—cached or not:
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: geolocation=(), microphone=()
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  1. Deactivated the plugin-based header management
    With the headers now handled at the server level, the Headers Security Advanced & HSTS WP plugin was safely deactivated to prevent redundancy.
  2. Validated scan results post-implementation
    After deployment, securityheaders.com confirmed all headers were active and consistent across cached and uncached responses. The site achieved an A+ security rating once again.

Final outcome

Freshy’s adjustments eliminated the inconsistent results caused by caching.

  • All security headers now apply globally, including cached files.
  • Security scanners correctly identify the site as compliant with best practices.
  • The caching plugin remains active, preserving performance benefits.
  • The client’s concern about spoofing and web vulnerabilities was fully addressed.

The resolution provided both technical hardening and reassurance that the site’s actual protection level was never compromised—only the scan interpretation was.

Technical takeaway

This case demonstrates a key principle in WordPress security management: when caching plugins serve static files, they may unintentionally omit dynamic security headers.

Best practices include:

  • Apply critical headers (e.g., HSTS, X-Frame-Options) at the server level for consistent delivery.
  • Test both cached and uncached responses before drawing conclusions from scan results.
  • Avoid stacking multiple header management systems (plugins + server rules).
  • Ensure caching plugins are configured to allow secure headers to persist.

By shifting from plugin-based to server-based header management, Freshy ensured that the site remains both fast and fully protected—with no false negatives in security scans.

Need help improving your site’s security?

If your site’s security scan results are inconsistent or showing false positives, Freshy can help implement server-level hardening, caching optimizations, and header configurations.
Contact Freshy today to ensure your WordPress site stays secure and performs at its best.