• Resolved r4yanw1ang

    (@r4yanw1ang)


    Hi everyone,

    I’m having trouble getting LiteSpeed Cache to actually cache my WordPress site. Despite enabling all the correct settings, my homepage and other pages consistently return:

    cache-control: no-cache, no-store, must-revalidate
    x-litespeed-cache-control: no-cache

    What I’ve Done So Far:

    • My server is LiteSpeed, confirmed via HTTP response headers.
    • Installed and activated LiteSpeed Cache plugin.
    • Enabled all cache options under LiteSpeed Cache → Cache.
    • TTL settings are set to default (1 week).
    • Homepage is not excluded in any exclusion fields.
    • I verified .htaccess includes the LSCache rules.
    • Tested the site using httpstatus.io and RedBot.org in Incognito mode.
    • Tried purging cache via LiteSpeed Toolbox.
    • Deactivated all plugins except LiteSpeed Cache.
    • Checked for DONOTCACHEPAGE in functions.php and plugin files — nothing found.
    • Tried using Force Public Cache URIs (/ 3600).
    • Maintenance mode is off.
    • Theme is TravelTour by GoodLayers.
    • Added this custom code to functions.php to override headers:

    add_action( 'send_headers', function() {
    header_remove('Cache-Control');
    header_remove('Pragma');
    header_remove('Expires');
    header('Cache-Control: public, max-age=3600');
    }, 100 );

    Question: Still seeing no-cache, and no x-litespeed-cache: hit.

    I feel like I’ve exhausted everything. Is there anything I’m missing?

    Thanks in advance for any guidance!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support litetim

    (@litetim)

    @r4yanw1ang please share me a report ID. This can be created from LSC => Toolbox => Report => click on “Send to Litespeed”.
    Send me that report ID only and we can continue debugging

    Thread Starter r4yanw1ang

    (@r4yanw1ang)

    @litetim thanks for reaching out.

    after I click “Send to Litespeed”, it shows an error message:
    [Cannot load litespeed-toolbox.]

    Plugin Support litetim

    (@litetim)

    @r4yanw1ang
    I have searched LSCWP for this error and I am not able to find any reference to this.
    Can you share the site link? Is it ok doing that?

    Do you have any security plugins? Like Wordfence, WPS Hide Login, any other firewall or custom code that will disable some XML-RPC functionalties?

    • This reply was modified 11 months, 2 weeks ago by litetim.
    Thread Starter r4yanw1ang

    (@r4yanw1ang)

    @litetim

    Hi, I managed to solve the [Cannot load litespeed-toolbox] problem by editing the wp-config.php file in cpanel. reference: https://ww.wp.xz.cn/support/topic/cannot-load-litespeed-toolbox/

    Here is the newly generated report id: RMWHRYDQ

    I’ve got the same issue: I’m using LiteSpeed and my host is Hostinger. Everything seem to work OK, but the Site Health keeps showing: “Page cache is not detected and the server response time is slow“.

    • Site: https://www.cookingupamazingtrips.com/
    • Error from Site Health: Page cache is detected by looking for an active page cache plugin as well as making three requests to the homepage and looking for one or more of the following HTTP client caching response headers:cache-controlexpiresagelast-modifiedetagx-cache-enabledx-cache-disabledx-srcache-store-statusx-srcache-fetch-statusx-litespeed-cachex-lsadc-cachex-qc-cache.
    • Report number: WGKFKWQK
    Plugin Support litetim

    (@litetim)

    @cookingupamazingtrips per forum guidelines, please create a new topic if you need support.
    Thank you

    @r4yanw1ang I am checking the report and info you provided. Nice work on resolving the Toolbox issue!

    Plugin Support litetim

    (@litetim)

    @r4yanw1ang let’s try adding this code:
    add_filter( 'litespeed_const_DONOTCACHEPAGE', '__return_false' );
    to the theme and see what it does.

    Thread Starter r4yanw1ang

    (@r4yanw1ang)

    @litetim

    Hi there, your code did not instantly work, but I managed to locate the issue. After checking Litespeed’s debug log, I saw the critical problem being:
    [X Cache_control -> no Cache (per post metabox setting)]

    So I went to Pages -> All Pages -> edit front page -> Litespeed Options -> turned off “Disable Cache”

    Then it worked. Anyway, thank you for your help!

    Plugin Support litetim

    (@litetim)

    Nice!
    You can remove my code, it does not need to run all the time

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘LiteSpeed Cache Not Working – no-cache Header Despite Plugin Enabled’ is closed to new replies.