Automattic / Automattic/wp-super-cache

Opt out of cache when WooCommerce cart isn't empty

Open
#875 0 comments 1 reaction 0 assignees View on GitHub
[Plugin] Super Cache enhancement
Dominant language
PHP
Stars
436
Forks
130
Avg merge
15h 11m
Merged PRs (30d)
10

Description

When on a WooCommerce site, we can opt out of cache if the cart isn't empty by checking for the `woocommerce_items_in_cart` cookie.

In the rewrite rules:
```
// This line
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$

// Becomes
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_|woocommerce_items_in_cart).*$
```

Maybe this should be subject to a checkbox in the options page.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating where the rewrite rules are generated and compare the existing cookie exclusion with the example in the issue. Check how cache options are exposed in the options page before deciding whether the WooCommerce exclusion should be configurable. Done means the cart cookie can bypass cache, with the checkbox question resolved; the issue names no test or file.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, devtools
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
49/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.