Intermittent issue: WP Super Cache serving some CSS/JS files incorrectly

A site I manage has been having intermittent issues lately that appear to be caused (at least in part) by WP Super Cache. So far, what I’ve been able to determine is below… has anyone experienced this before or have any suggestions for fixes?

# Issue Description

Certain pages appear to be missing CSS while visiting the site logged out.

Looking at the network inspector in the browser, it’s evident that **some CSS and JS files are being blocked as mixed content because they’re being served over HTTP instead of HTTPS, despite the site being configured to force HTTPS**.

Clearing the cache immediately fixes the issue (temporarily).

The issue will not present itself for weeks, then seemingly randomly re-occur.

The issue does not seem to occur (as far as I can tell) when WP Super Cache is in “Simple” mode.

The site does not have any issues with mixed content or content being served over HTTP outside of this intermittent issue.

# WP Super Cache Configuration

Set to “Expert” mode. These default rules are added into .htaccess for faster caching:

# BEGIN WPSuperCache
# The directives (lines) between “BEGIN WPSuperCache” and “END WPSuperCache” are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#If you serve pages from behind a proxy you may want to change ‘RewriteCond %{HTTPS} on’ to something more sensible
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{HTTPS} on
RewriteCond PATH-REMOVED-FOR-PRIVACY/web/content/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
RewriteRule ^(.*) “/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz” [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{HTTPS} !on
RewriteCond PATH-REMOVED-FOR-PRIVACY/web/content/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
RewriteRule ^(.*) “/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz” [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTPS} on
RewriteCond PATH-REMOVED-FOR-PRIVACY/web/content/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
RewriteRule ^(.*) “/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html” [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC] RewriteCond %{HTTPS} !on
RewriteCond PATH-REMOVED-FOR-PRIVACY/web/content/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
RewriteRule ^(.*) “/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html” [L] </IfModule>

# END WPSuperCache

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer