• Resolved Tim

    (@tkaufmann)


    Hi,

    as soon as I enable custom sidebars on my blog, nginx stops caching my pages. I found out that the Cache-Control HTTP header is being set to “no-store, no-cache, must-revalidate, post-check=0, pre-check=0”. Cache-Control disappears after deactivating the custom sidebars plugin.

    Please advise,

    Tim

    https://www.ads-software.com/plugins/custom-sidebars/

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

    (@tkaufmann)

    Further investigation lead to the following, temporary solution:

    in custom-sidebars/inc/class-custom-sidebars-explain.php comment out line 55 (session_start()).

    In custom-sidebars/inc/external/wpmu-lib/functions-wpmulib.php comment out line 69 (session_start())

    Which leads to another questions: Are those sessions a requirement or just a feature of the library?

    Hi Tim,

    I hope you are well today.

    The sessions are used to store the explain state and some other information.

    If the plugin is working fine for you after deactivating the above code then it’s ok but if you are facing any issue with it then please share me your site link so that i can test the Cache-Control HTTP header on your site as i am not getting this on my test site.

    Kind Regards,
    WPMU DEV

    Thread Starter Tim

    (@tkaufmann)

    We’re hosting on nginx. Could it be that wordpress’ nginx mode is triggering that behaviour? In my opinion, a sidebar plugin should not trigger cache headers in the frontend ??

    Hi Tim,

    Thank you for your reply.

    I don’t think this is nginx related issue, i discussed it with the plugin developer and he said the session is needed on the Admin Dashboard only, not on the page itself, so we are going to add a condition as following to only use it there.

    if ( ! session_id() && is_admin() ) {
    	session_start();
    }

    The developer also said that it might be related to the PHP default setting for session-caching

    https://php.net/manual/en/function.session-cache-limiter.php

    If session is enabled the default PHP session_cache_limiter is “nocache”

    The user might solve the issue by inserting this line directly before session_start

    session_cache_limiter('public');

    Could you please try using the above solutions provided by the plugin developer?

    Regards,
    WPMU DEV

    Thread Starter Tim

    (@tkaufmann)

    Sorry, took me a while to get back to you. Both suggested solutions work.

    Hi Tim,

    Thank you for your reply and glad the suggested solutions worked for you.

    If we can be of any further assistance please don’t hesitate to ask ??

    Cheers,
    Vinod Dalvi

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom sidebars sending Cache-Control header’ is closed to new replies.