• Resolved Amar Ilindra

    (@amarilindra)


    I’m adding custom HTTP headers to a few of my blog posts as follows

    add_action('template_redirect', 'gd_custom_http_headers');
    
    function gd_custom_http_headers() {
    
       // our logic based on post ID
       header('X-Robots-Tag: nofollow');
    
       // sometimes
       header('X-GD-API-KEY: xxxxxxxxxxxxxxxxxxxx');
    
    }

    1. It works fine initially “with” and “without” cache buster parameter swcfpc=1

    2. After few days (2-3 days), all my custom headers were missing. However, if I log in and add swcfpc=1 parameter, I could see my custom headers correctly.

    3. When I hit “Purge whole cache”, it started working again temporarily for 2-3 days.

    I’m not sure where I’m doing it wrong.

    Thank you

    Note: Website is running on LiteSpeed server and FlyingPress for files optimizations. I have already disabled FlyingPress cache and enabled Fallback cache in your plugin.

    • This topic was modified 5 years ago by Amar Ilindra. Reason: Code formatting

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Amar Ilindra

    (@amarilindra)

    Hi @isaumya

    Your feedback on this is really helpful.

    Thank you

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @amarilindra,
    Can you try enabling the fallback cache and then inside the fallback cache turn on the option for saving headers. See if it works after that.

    Thread Starter Amar Ilindra

    (@amarilindra)

    Hi @isaumya

    The fallback cache is already enabled and now as you suggested, I enabled the “Save response headers” option.

    I’ll keep monitoring my custom HTTP headers and update you accordingly.

    Plugin Contributor iSaumya

    (@isaumya)

    OK. Keep me posted. Also, make sure there is no other page caching solution is being used besides this plugin.

    Thread Starter Amar Ilindra

    (@amarilindra)

    Hi @isaumya

    The website is on Closte (https://closte.com/) and they have a built-in object and OP cache.

    Do I need to disable them as well.

    Plugin Contributor iSaumya

    (@isaumya)

    No, Object Cache and OP Cache are fine. You can keep them.

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

The topic ‘Custom HTTP Headers Missing’ is closed to new replies.