• Resolved thesun1

    (@thesun1)


    Hi,

    I want to keep my page output html static, so I can easily cache it.
    Unfortunately the method pys_add_code_to_woo_cart_link creates a unique event id ($event_id = uniqid();) to reference button click to ajax call.
    Is there a good reason for this or could we generate the id based on the product this link refers to so the output remains static?

    Cheers,
    sun

    P.S.: I’m aware that even this “dynamic” page can be cached in whole if we cache the button and the ajax script. Still it is annoying and could break with fragment caching.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thesun1

    (@thesun1)

    Thinking a bit more about it.
    Would this solve it and work for you?

    Move down the event_id generation until after the $params array has been filled.
    Then
    $event_id = "atc_".md5(serialize($params));

    This way it is stable between requests but fully dynamic to be unique per product.

    Plugin Author PixelYourSite

    (@pixelyoursite)

    Hi,

    I think it’s a good suggestion. We will implement it soon in our next update.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can we remove dynamic event_id to allow site caching?’ is closed to new replies.