• Resolved acsnaterse

    (@acsnaterse)


    Hi there,

    In the settings, there is an option to use cache for logged in users.
    How does this option work exactly? Is this a private cache per user, or does it creates a common cache for all users that are logged in?

    The backstory of this question is that we want to show different data for different users/roles. And we were wondering if this option should solve it (if so, we might have found an issue ?? ), or that we are bound to use options like this: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:simucrawler

    Thanks in advance!

    Kind regards,
    Arjan

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

    (@qtwrk)

    Hi,

    when ESI OFF , they are private cache to each user

    when ESI ON , the part of page is public page shared among all login user , and where certain sector where you configured as ESI block , will be private to each user

    Best regards,

    Thread Starter acsnaterse

    (@acsnaterse)

    Hi,
    Thanks for your quick reply.

    Is the private cache per user only for the page cache, or is there also a private layer in the object cache (or other caches).

    Because what we’re seeing in our WooCommerce store that some users don’t see all product variations. And those variations are role based.
    Without the cache, or when the cache is emptied, it works great, but after a while (not structural reproducable), some users don’t see “their” product variations anymore.

    Any clue of what this could be?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    from my undersanding about the object cache , LSCWP merely provides a bridge to redis/memcached , itself doesn’t differentiate or privatize anything , it depends on how plugin adds/set the cache key

    e.g.

    [root@cpanel woocommerce]# grep -riF "wp_cache_"
    uninstall.php:	wp_cache_flush();
    packages/action-scheduler/classes/ActionScheduler_QueueRunner.php:			wp_cache_flush();
    includes/wc-order-functions.php:	$cached_count = wp_cache_get( $cache_key, 'counts' );
    includes/wc-order-functions.php:	wp_cache_set( $cache_key, $count, 'counts' );
    includes/wc-term-functions.php:	$terms       = wp_cache_get( $cache_key, $cache_group );
    includes/wc-term-functions.php:	wp_cache_add( $cache_key, $terms, $cache_group );
    includes/class-wc-session-handler.php:			wp_cache_set( $this->get_cache_prefix() . $this->_customer_id, $this->_data, WC_SESSION_CACHE_GROUP, $this->_session_expiration - time() );
    includes/class-wc-session-handler.php:		$value = wp_cache_get( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );
    includes/class-wc-session-handler.php:				wp_cache_add( $this->get_cache_prefix() . $customer_id, $value, WC_SESSION_CACHE_GROUP, $cache_duration );
    includes/class-wc-session-handler.php:		wp_cache_delete( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );
    includes/class-wc-tax.php:		$matched_tax_rates = wp_cache_get( $cache_key, 'taxes' );
    includes/class-wc-tax.php:			wp_cache_set( $cache_key, $matched_tax_rates, 'taxes' );
    includes/class-wc-tax.php:		$tax_rate_classes = wp_cache_get( $cache_key, 'taxes' );
    includes/class-wc-tax.php:			wp_cache_set( $cache_key, $tax_rate_classes, 'taxes' );
    includes/class-wc-tax.php:		wp_cache_delete( 'tax-rate-classes', 'taxes' );
    includes/class-wc-tax.php:		wp_cache_delete( 'tax-rate-classes', 'taxes' );
    includes/data-stores/class-wc-product-variable-data-store-cpt.php:		$cached_data          = wp_cache_get( $cache_key, $cache_group );
    includes/data-stores/class-wc-product-variable-data-store-cpt.php:		wp_cache_set( $cache_key, $variation_attributes, $cache_group );
    includes/data-stores/abstract-wc-order-data-store-cpt.php:		wp_cache_delete( 'order-items-' . $order->get_id(), 'orders' );
    includes/data-stores/abstract-wc-order-data-store-cpt.php:		$items = 0 < $order->get_id() ? wp_cache_get( 'order-items-' . $order->get_id(), 'orders' ) : false;
    includes/data-stores/abstract-wc-order-data-store-cpt.php:				wp_cache_set( 'item-' . $item->order_item_id, $item, 'order-items' );
    includes/data-stores/abstract-wc-order-data-store-cpt.php:				wp_cache_set( 'order-items-' . $order->get_id(), $items, 'orders' );
    includes/data-stores/class-wc-data-store-wp.php:		$existing_data = wp_cache_get( 'lookup_table', 'object_' . $id );
    includes/data-stores/class-wc-data-store-wp.php:			wp_cache_set( 'lookup_table', $update_data, 'object_' . $id );
    includes/data-stores/class-wc-data-store-wp.php:		wp_cache_delete( 'lookup_table', 'object_' . $id );
    includes/data-stores/class-wc-order-item-data-store.php:		wp_cache_delete( 'item-' . $item_id, 'order-items' );
    includes/data-stores/class-wc-order-item-data-store.php:			wp_cache_delete( 'order-items-' . $order_id, 'orders' );
    includes/data-stores/class-wc-order-refund-data-store-cpt.php:		wp_cache_delete( $refund_cache_key, 'orders' );
    includes/data-stores/class-wc-webhook-data-store.php:		$data = wp_cache_get( $webhook->get_id(), 'webhooks' );
    includes/data-stores/class-wc-webhook-data-store.php:			wp_cache_add( $webhook->get_id(), $data, 'webhooks' );
    includes/data-stores/class-wc-webhook-data-store.php:		wp_cache_delete( $webhook->get_id(), 'webhooks' );
    includes/data-stores/class-wc-webhook-data-store.php:		wp_cache_delete( $webhook->get_id(), 'webhooks' );
    includes/data-stores/class-wc-webhook-data-store.php:		$cache_value = wp_cache_get( $cache_key, 'webhook_search_results' );
    includes/data-stores/class-wc-webhook-data-store.php:		wp_cache_set( $cache_key, $return_value, 'webhook_search_results' );
    includes/data-stores/class-wc-webhook-data-store.php:		$count     = wp_cache_get( $cache_key, 'webhooks' );
    includes/data-stores/class-wc-webhook-data-store.php:			wp_cache_add( $cache_key, $count, 'webhooks' );
    includes/data-stores/class-wc-coupon-data-store-cpt.php:			wp_cache_delete( WC_Cache_Helper::get_cache_prefix( 'coupons' ) . 'coupon_id_from_code_' . $coupon->get_code(), 'coupons' );
    includes/data-stores/class-wc-product-data-store-cpt.php:		wp_cache_delete( $product_id_with_stock, 'post_meta' );
    includes/data-stores/class-wc-product-data-store-cpt.php:		wp_cache_delete( $product_id_with_stock, 'post_meta' );
    includes/data-stores/class-wc-product-data-store-cpt.php:		wp_cache_delete( $product_id, 'post_meta' );
    includes/data-stores/class-wc-product-data-store-cpt.php:		$product_type = wp_cache_get( $cache_key, 'products' );
    includes/data-stores/class-wc-product-data-store-cpt.php:		wp_cache_set( $cache_key, $product_type, 'products' );
    includes/data-stores/abstract-wc-order-item-type-data-store.php:		$data = wp_cache_get( 'item-' . $item->get_id(), 'order-items' );
    includes/data-stores/abstract-wc-order-item-type-data-store.php:			wp_cache_set( 'item-' . $item->get_id(), $data, 'order-items' );
    includes/data-stores/abstract-wc-order-item-type-data-store.php:		wp_cache_delete( 'item-' . $item->get_id(), 'order-items' );
    includes/data-stores/abstract-wc-order-item-type-data-store.php:		wp_cache_delete( 'order-items-' . $item->get_order_id(), 'orders' );
    includes/data-stores/abstract-wc-order-item-type-data-store.php:		wp_cache_delete( $item->get_id(), $this->meta_type . '_meta' );
    includes/data-stores/class-wc-order-data-store-cpt.php:			wp_cache_set( $cache_keys_mapping[ $order_id ], $refunds, 'orders' );
    includes/data-stores/class-wc-order-data-store-cpt.php:			wp_cache_set( 'order-items-' . $order_id, $items, 'orders' );
    includes/data-stores/class-wc-order-data-store-cpt.php:			wp_cache_set( 'item-' . $item->order_item_id, $item, 'order-items' );
    includes/rest-api/Controllers/Version1/class-wc-rest-products-v1-controller.php:		wp_cache_delete( 'product-' . $product->get_id(), 'products' );
    includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php:		wp_cache_delete( 'product-' . $object->get_id(), 'products' );
    includes/rest-api/Controllers/Version2/class-wc-rest-product-variations-v2-controller.php:		wp_cache_delete( 'product-' . $object->get_parent_id(), 'products' );
    includes/rest-api/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php:				wp_cache_flush();
    includes/wc-core-functions.php:	$template  = (string) wp_cache_get( $cache_key, 'woocommerce' );
    includes/wc-core-functions.php:	$template  = (string) wp_cache_get( $cache_key, 'woocommerce' );
    includes/wc-core-functions.php:	wp_cache_set( $cache_key, $template, 'woocommerce' );
    includes/wc-core-functions.php:	$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
    includes/wc-core-functions.php:	wp_cache_set( 'cached_templates', $cached_templates, 'woocommerce' );
    includes/wc-core-functions.php:	$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
    includes/wc-core-functions.php:			wp_cache_delete( $cache_key, 'woocommerce' );
    includes/wc-core-functions.php:		wp_cache_delete( 'cached_templates', 'woocommerce' );
    includes/wc-core-functions.php:	$size      = wp_cache_get( $cache_key, 'woocommerce' );
    includes/wc-core-functions.php:	wp_cache_set( $cache_key, $size, 'woocommerce' );
    includes/wc-core-functions.php: * Polyfill for wp_cache_get_multiple for WP versions before 5.5.
    includes/wc-core-functions.php:	if ( function_exists( 'wp_cache_get_multiple' ) ) {
    includes/wc-core-functions.php:		return wp_cache_get_multiple( $keys, $group, $force );
    includes/wc-core-functions.php:		$values[ $key ] = wp_cache_get( $key, $group, $force );
    includes/class-wc-post-data.php:			wp_cache_delete( 'product-' . $object_id, 'products' );
    includes/wc-coupon-functions.php:	$ids        = wp_cache_get( WC_Cache_Helper::get_cache_prefix( 'coupons' ) . 'coupon_id_from_code_' . $code, 'coupons' );
    includes/wc-coupon-functions.php:			wp_cache_set( WC_Cache_Helper::get_cache_prefix( 'coupons' ) . 'coupon_id_from_code_' . $code, $ids, 'coupons' );
    includes/wc-update-functions.php:			wp_cache_flush();
    includes/wc-update-functions.php:			wp_cache_delete( WC_Cache_Helper::get_cache_prefix( 'coupons' ) . 'coupon_id_from_code_' . $data['post_title'], 'coupons' );
    includes/wc-attribute-functions.php:	$cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	wp_cache_set( $cache_key, $attribute_taxonomies, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	$cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	wp_cache_set( $cache_key, $taxonomy_ids, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	$cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	wp_cache_set( $cache_key, $taxonomy_labels, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	$cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' );
    includes/wc-attribute-functions.php:	wp_cache_set( $cache_key, $attribute_slug, 'woocommerce-attributes' );
    includes/wc-template-functions.php:	wp_cache_flush(); // Flush any caches which could impact settings or templates.
    includes/wc-template-functions.php:		$product_categories = $cache_key ? wp_cache_get( $cache_key, 'product_cat' ) : false;
    includes/wc-template-functions.php:				wp_cache_set( $cache_key, $product_categories, 'product_cat' );
    includes/class-wc-shipping-zones.php:		$matching_zone_id = wp_cache_get( $cache_key, 'shipping_zones' );
    includes/class-wc-shipping-zones.php:			wp_cache_set( $cache_key, $matching_zone_id, 'shipping_zones' );
    includes/class-wc-cache-helper.php:	 * Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
    includes/class-wc-cache-helper.php:		$prefix = wp_cache_get( 'wc_' . $group . '_cache_prefix', $group );
    includes/class-wc-cache-helper.php:			wp_cache_set( 'wc_' . $group . '_cache_prefix', $prefix, $group );
    includes/class-wc-cache-helper.php:		wp_cache_set( 'wc_' . $group . '_cache_prefix', microtime(), $group );
    includes/class-wc-cache-helper.php:				wp_cache_delete( 'product-category-hierarchy-' . $id, 'product_cat' );
    includes/class-wc-countries.php:		$codes = wp_cache_get( 'calling-codes', 'countries' );
    includes/class-wc-countries.php:			wp_cache_set( 'calling-codes', $codes, 'countries' );
    includes/class-wc-order.php:		$cached_data = wp_cache_get( $cache_key, $this->cache_group );
    includes/class-wc-order.php:		wp_cache_set( $cache_key, $this->refunds, $this->cache_group );
    includes/class-wc-order.php:		$cached_data = wp_cache_get( $cache_key, $this->cache_group );
    includes/class-wc-order.php:		wp_cache_set( $cache_key, $total_refunded, $this->cache_group );
    includes/class-wc-order.php:		$cached_data = wp_cache_get( $cache_key, $this->cache_group );
    includes/class-wc-order.php:		wp_cache_set( $cache_key, $total_refunded, $this->cache_group );
    includes/class-wc-order.php:		$cached_data = wp_cache_get( $cache_key, $this->cache_group );
    includes/class-wc-order.php:		wp_cache_set( $cache_key, $total_refunded, $this->cache_group );
    includes/legacy/api/class-wc-rest-legacy-products-controller.php:		wp_cache_delete( 'product-' . $product->get_id(), 'products' );
    includes/abstracts/abstract-wc-widget.php:		$cache = wp_cache_get( $this->get_widget_id_for_cache( $this->widget_id ), 'widget' );
    includes/abstracts/abstract-wc-widget.php:		$cache = wp_cache_get( $this->get_widget_id_for_cache( $this->widget_id ), 'widget' );
    includes/abstracts/abstract-wc-widget.php:		wp_cache_set( $this->get_widget_id_for_cache( $this->widget_id ), $cache, 'widget' );
    includes/abstracts/abstract-wc-widget.php:			wp_cache_delete( $this->get_widget_id_for_cache( $this->widget_id, $scheme ), 'widget' );
    includes/abstracts/abstract-wc-data.php:			wp_cache_set( $cache_key, $raw_meta_data_array, $cache_group );
    includes/abstracts/abstract-wc-data.php:				$cached_meta  = wp_cache_get( $cache_key, $this->cache_group );
    includes/abstracts/abstract-wc-data.php:				wp_cache_set( $cache_key, $raw_meta_data, $this->cache_group );
    includes/abstracts/abstract-wc-data.php:			wp_cache_delete( $cache_key, $this->cache_group );
    src/Internal/AssignDefaultCategory.php:			wp_cache_flush();

    Best regards,

    Thread Starter acsnaterse

    (@acsnaterse)

    Okay, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Private caching per user, or all login users together?’ is closed to new replies.