Hello tagDiv Team,
I am using your Newspaper theme on a **LiteSpeed Server** (Hostinger) with the official **LiteSpeed Cache** (LSC) plugin.
The problem is that my site (laikmetis.lt) is not being cached. The response header always shows x-litespeed-cache: miss, and the HTML comment at the bottom of the page says “Page generated”, not “Page cached”.
I have run tests and **100% confirmed this conflict is caused only by the Newspaper theme**:
* **Test 1 (Newspaper theme active):** The result is x-litespeed-cache: miss.
* **Test 2 (Default Twenty Twenty-Four theme active):** The result is x-litespeed-cache: hit. (The page caches perfectly).
I have already tried every possible solution from the LSC plugin side, but your theme overrides all settings. I have already:
1. Confirmed that LiteSpeed Cache -> [4] Excludes settings are all empty.
2. Confirmed that LiteSpeed Cache -> [4] Do Not Cache Cookies is empty.
3. **Most importantly:** Added / (the front page) to LiteSpeed Cache -> [1] Force Cache URIs. Even with this “force” setting, your theme **still blocks** the page from being cached.
**Important Clarification:**
Please **do not** suggest that I use WP Super Cache or WP Rocket. This is **not a solution**, as I am on a **LiteSpeed Server**. Using any plugin other than LiteSpeed Cache means a massive performance loss. The goal is to make your theme compatible with my server, not to abandon my server’s advantages.
**My Request:**
These tests prove that the Newspaper theme (or TagDiv Composer) is actively sending a no-cache header or using a PHP constant (like DONOTCACHEPAGE).
Please provide a specific solution (a code snippet for functions.php or a hidden setting) so I can **disable** your theme’s no-cache signal. This is necessary to allow the LiteSpeed Cache plugin to finally function correctly.
-
This topic was modified 9 months by
Marusis.
Hi,
Our theme do not use no-cache or DONOTCACHEPAGE.
Also, testing with a theme like “Twenty Twenty-Four” that does not have any features and comparing it with the Newspaper theme that you can build almost anything, I think, is not a good comparison, but if this is indeed something related to our theme make some tests like this. Use only the Newspaper theme without any extra plugins except the cache plugin. If it’s ok, go on with tagDiv Composer, this is the hard part of the theme. Then, with tagDiv Cloud Library and so on, until you test it with all the theme plugins you are using.
The text step after you identify the plugin that is interfering with the cache is to check the cache settings. From my experience, setting ‘/’ in cache fields will be interpreted to not cache the homepage, but this is maybe only my interpretation.
As a suggestion you can try a code like this one in the child theme (the code needs to be adjusted):
add_action( 'template_redirect', function() {
if ( class_exists( 'LSCache\\LSCWP' ) ) {
// Remove any DONOTCACHEPAGE flag that may have been set earlier
if ( defined( 'DONOTCACHEPAGE' ) && DONOTCACHEPAGE ) {
// Un-define the constant (only works if not locked), or override via filter
// Note: PHP doesn't allow undefining a constant, so we use filter below
}
// Use our filter to override caching logic
add_filter( 'litespeed_cache_allow_cache', function( $allow ) {
return true;
}, 99 );
// Clear any HTTP headers forcing no-cache
header_remove( 'Cache-Control' );
header_remove( 'Pragma' );
}
}, 0 );
Thank you!
Hello Calin,
Thank you for the suggestions. I have followed your advice and performed a step-by-step conflict test. I have found the exact cause of the problem.
Here are the results:
Test 1: I activated the default Twenty Twenty-Four theme with only LiteSpeed Cache active.
Result: x-litespeed-cache: hit. The cache works perfectly.
Test 2: I activated the Newspaper theme (v 12.7.3) with only LiteSpeed Cache active. All other plugins (including TagDiv Composer) were disabled.
Result: x-litespeed-cache: miss.
This test proves that the conflict is 100% inside the main Newspaper theme itself, not with another plugin. The theme is actively sending a no-cache signal as soon as it is activated.
Your functions.php code snippet from the last email did not solve this problem.
Please provide a working solution to disable this no-cache signal coming directly from the theme. I am on a LiteSpeed server and must use the LiteSpeed Cache plugin.
Thank you.
Hi,
Please run a quick debugging snippet (in a temporary plugin or in functions.php), you can check if the theme defines that constant:
add_action( 'init', function() {;
if ( defined( 'DONOTCACHEPAGE' ) && DONOTCACHEPAGE ) {
error_log( 'DONOTCACHEPAGE is defined by theme at init' );
}
})
Check your PHP error log. If you see that message, it confirms the culprit.
Constants cannot be undefined once set, the only safe way to override this is to prevent it before the theme sets it.
add_action( 'plugins_loaded', function() {
// Prevent the theme from defining DONOTCACHEPAGE later
if ( ! defined( 'DONOTCACHEPAGE' ) ) {
define( 'DONOTCACHEPAGE', false );
}
// Intercept no-cache headers
add_filter( 'nocache_headers', '__return_empty_array' );
});
How to test this safely
– Go to /wp-content/mu-plugins/ (create the folder if it doesn’t exist).
– Create a file called allow-litespeed-cache.php.
– Paste the code above.
– Clear all caches (LiteSpeed → Purge All).
– Open your site in a private/incognito window.
– Check response headers again.
If it now shows: x-litespeed-cache: hit, then the problem is confirmed and fixed.
I hope this will help you!
Thank you!
Hi Alext8,
If the suggestions above aren’t working, I recommend reaching out to the Lightspeed support team. They will be able to provide better guidance on what to do next. Please note that our support for the Lightspeed plugin is limited.
Thank you for your understanding!