Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cookie value for page cache hash to be customizable #3

Closed
syclone opened this issue May 14, 2020 · 0 comments
Closed

Allow cookie value for page cache hash to be customizable #3

syclone opened this issue May 14, 2020 · 0 comments

Comments

@syclone
Copy link

syclone commented May 14, 2020

First of all, thank you for the excellent performance plugin. It is my favorite.

Hummingbird currently has the ability to take into consideration the cookies when generating cached pages in the get_cookies() function.

I would like to add my own cookie into the list used to generate the hash. I think it would be a great addition the list of cookies could be updated/customizable from the admin interface similar to the Exclusion section.

foreach ( (array) $_COOKIE as $key => $value ) { // Input var ok.
	// Check password protected post, comment author, logged in user.
	if ( preg_match( '/^wp-postpass_|^comment_author_|^wordpress_logged_in_/', $key ) ) {
	      self::log_msg( 'Found cookie: ' . $key );
	      $cookie_value .= $_COOKIE[ $key ] . ','; // Input var ok.
        }
}

This can be be customizable '/^wp-postpass_|^comment_author_|^wordpress_logged_in_/'

This would be useful when running special campaigns and would like to provide alternate information on the same page using a campaign tracking cookie.

Thanks again

@syclone syclone closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant