Hello @asafm7,
The sgo_bypass_cookies filter does work with partial match and will exclude both test and test123.
This filter, however, works only for File Based Caching and the cookie value will not be taken into account.
Still, the Dynamic Caching functionality excludes by default the most commonly used cookies such as wordpress_logged_in_. You may find a list of all of the cookies that bypass the cache in the article below:
https://www.siteground.com/kb/siteground-dynamic-caching-configuration/#Cookies
In case there are other cookies used by the website which are not excluded from the Dynamic caching you can use headers to manage cache control. We support all the standard Cache-control header values that all CMS apps support:
cache-control: no-cache – passing this header tells our system not to cache this request
cache-control: max-age – this header tells our system to cache this request for X amount of seconds
Best regards,
Daniela Ivanova
Thread Starter
asafm7
(@asafm7)
Thanks @daniellaivanova .
I assume the nocache_headers() core WordPress function will be useful for excluding from dynamic caching?
Will you consider sharing a tested code example, with the best filter/action hook?
These things are a bit tricky to get right, and you have an advantage. It will also help other users.
Thanks.
Indeed, the nocache_headers() core WordPress function can be used for excluding content from the dynamic caching.
Additionally, you can use the built-in functionality of the plugin to exclude URLs or specific post types from caching. You can find it on your website’s Dashboard > SG Optimizer > Caching page.
Regarding an example for the best filter/action hook – I am afraid that we are not able to provide such because it depends mainly on the final goal.
Best regards,
Daniela Ivanova