• Resolved precies

    (@precies)


    Hello,

    We have a website build with WordPress and custom made PHP templates.

    I’m reading and searching a lot on the internet for a solution to make a “fragment” of our template “not cachable” or at least set a different TTL.

    Now I read a lot about ESI but I don’t know how to use it in my specific situation.

    To give you an example:

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Example</title>
    </head>
    
    <body>
    	<div class="public-cache">
    		<p>This content is public and part of the whole site cache</p>
    	</div>
    	<div class="private-cache">
    		<p>This content is PRIVATE and should be cached with another TTL</p>
    	</div>
    </body>
    </html>

    How can I made a part of my template code (div) not part of the public cache and give it another TTL?

    Is something like this even possible like this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Thread Starter precies

    (@precies)

    Hello,

    Thank you so much for this article. I managed to set it up like you set but for some reason the TTL is not working.

    I set it to 300 (thats like 5 minutes right?) but on every page refresh the Block is generated again.

    <!– Block generated by LiteSpeed Cache 4.4.3 on 2021-10-26 09:04:11 –>

    I get this comment and on every refresh the time changes. So the function is working and it is not part of the other cache anymore but the TTL is not working either. Any idea why the TTL is not working. I used it like this:

    function my_esi_block_esi_load()
    {
    do_action( 'litespeed_control_set_ttl', 300 );
    MYCODE
    }

    Also is there a way to hide the comment that is generated now?

    Plugin Support qtwrk

    (@qtwrk)

    I think this is a bug , reported to dev for further investigation

    Thread Starter precies

    (@precies)

    Hello,

    Thank you for your response. Do you have any idea when you get back from dev?
    Maybe you can leave the threath open until there is a solution so you can share this with me?:)

    Plugin Support usabe

    (@usabe)

    Hello @precies

    Could you please open a ticket here? https://store.litespeedtech.com/store/submitticket.php

    This function has been there for a while and we didn’t get report regarding this. Not sure how you implement this exactly. We may need to check into your site and server further for investigation.

    Please mentioned this post in the ticket and you can ask to assign your ticket to Abe.

    Best regards,
    Abe

    Thread Starter precies

    (@precies)

    Thank you for getting back to me. Was a little busy so did not had the time to submit a ticket.

    I just did so hopefully we can solve this:)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude part of template with ESI from cache’ is closed to new replies.