Hello,
I am using Newspaper 12.7.6 with WP Super Cache 3.1.1 on Nginx/PHP 7.4.
WP Super Cache works correctly and makes the site very fast, but I have a problem only with the homepage on mobile devices.
The homepage was created with the tagDiv/Newspaper mobile page layout. When WP Super Cache is enabled, the mobile homepage sometimes displays incorrectly on a real mobile phone. Articles and category pages seem to work fine.
My current WP Super Cache settings are based on your guide:
https://forum.tagdiv.com/cache-plugin-install-and-configure/
When I exclude both is_front_page and is_home from caching, the homepage displays correctly on mobile devices.
My question is: how can I safely cache the homepage with WP Super Cache without breaking the mobile homepage layout?
Should the homepage be excluded from cache, or is there a specific WP Super Cache setting recommended for a Newspaper/tagDiv mobile homepage?
Thank you.
Hi,
If you are using dedicated mobile content, such as the mobile theme plugin or mobile pages built with the composer, then please make sure that this setting is active -> https://prnt.sc/NKWqk2qeG5yd Or else the desktop/mobile version can get mixed up.
If that setting is active then the problem should be solved, assuming the super cache is the only cache used on the website.
Or is the problem different perhaps?
Thank you!
Hi,
Thank you for your previous reply.
I made a controlled test on copied homepage pages, not on the live homepage.
Test pages:
– Desktop copy: https://bokanews.me/boka-news-2/
– Mobile copy: https://bokanews.me/boka-news-2-mobile/
WP Super Cache settings:
– Caching On
– Simple mode
– Disable caching for logged-in visitors
– Compress pages
– Cache rebuild
– 304 browser caching
– Mobile device support enabled
– Late init enabled
I also limited WP Super Cache to cache only these two test URLs, so the rest of the website is not cached.
Current test result:
1. The desktop copy is cached successfully:
wp-content/cache/supercache/bokanews.me/boka-news-2/index-https.html
2. The mobile copy is cached successfully as a separate mobile cache file:
wp-content/cache/supercache/bokanews.me/boka-news-2-mobile/index-https-mobile.html
3. When I open the mobile copy directly on a phone:
https://bokanews.me/boka-news-2-mobile/
it displays correctly.
4. But when I open the desktop copy URL on a real mobile phone:
https://bokanews.me/boka-news-2/
it opens the desktop copy and displays incorrectly. It does not switch to the mobile layout/page.
On the real homepage I also tested WP Super Cache with Mobile device support enabled. WP Super Cache created only:
wp-content/cache/supercache/bokanews.me/index-https.html
but it did not create:
wp-content/cache/supercache/bokanews.me/index-https-mobile.html
As a result, mobile visitors received the same cached homepage as desktop visitors, and the mobile homepage displayed incorrectly.
So the issue seems to be with the Newspaper/tagDiv Composer dedicated mobile homepage and WP Super Cache: even with Mobile device support enabled, the real homepage does not reliably generate and serve a separate mobile cache file.
Thank you.
Hi,
That is very unusual. Even with the browser inspector I’m not seeing the mobile page when I check the desktop page -> https://prnt.sc/I07-OXZNZo-X I can see it if I add a parameter after the URL -> https://prnt.sc/Gna7zUnVf4yu and the page still seems to be cached by super cache. The parameter is however bypassing something if the mobile page is displayed.
The thing is, the super cache plugin has been our recommended caching plugin since the theme was released, mainly because it works correctly when using dedicated mobile content. Of course, now there are many other caching plugins, but most of them have options to create and serve separate caches desktop/mobile.
I can confirm that while using the super cache, the desktop/mobile content of the theme is always served correctly. I have never seen it fail. I saw similar cases like this before, and it always turned out that there were other caching systems active.
If I may ask, what kind of hosting are you using for the website? Are you sure there is no server cache of any kind? I can check as well in their documentation. Let me know.
Thank you!
Hi,
Thank you for your help.
I found the cause and confirmed it with testing.
The issue was not caused by Redis Object Cache, OPcache, Cloudflare, LiteSpeed, WP Rocket, or another WordPress caching plugin.
The site is hosted on a self-managed VPS using WordOps with Nginx and PHP-FPM 7.4. WordOps uses an Nginx-level WP Super Cache integration:
include common/wpsc-php74.conf;
The active Nginx rule was serving WP Super Cache static HTML files directly before WordPress/Newspaper could run.
The original WordOps rule was looking for the mobile HTTPS cache file in this order:
index${mobile_prefix}${https_prefix}.html
On my server:
mobile_prefix = -mobile
https_prefix = -https
So Nginx was looking for:
index-mobile-https.html
However, WP Super Cache generates the mobile HTTPS file as:
index-https-mobile.html
Because Nginx could not find the mobile cache file, it fell back to:
index-https.html
As a result, mobile visitors were receiving the desktop cached file before WordPress/Newspaper could serve the dedicated mobile content.
This also explains why adding a query parameter made the mobile layout appear correctly, because that bypassed the direct static cache delivery.
I adjusted the Nginx WPSC rule so it now looks for:
index${https_prefix}${mobile_prefix}.html
I also prevented mobile requests from falling back to the desktop cache file if the mobile cache file does not exist.
After clearing cache, the homepage and other pages now generate separate cache files correctly:
index-https.html
index-https-mobile.html
I tested the homepage, a post, and a category page on both desktop and mobile user agents. The first request generates the cache, and the following requests are served very fast. The mobile layout now displays correctly on a real phone as well.
So the root cause was the WordOps/Nginx WP Super Cache static delivery rule, not the Newspaper theme or WP Super Cache plugin itself.
Thank you again for your assistance.
