Comments (6)
Hi Karl,
in 'etc/nginx/conf.d/custom/fpm-wordpress-cache-users.conf" I added "/cart/ " to:
if ($request_uri ~* "/cart/|/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
set $skip_cache 1;
}
It seems to be working fine.
Would you think this is the best way to do it or would you advise otherwise?
Thanks
from nginx-more.
Hi,
You should be good with the following on WooCommerce:
if ( $cookie_woocommerce_items_in_cart = "1" ){
set $skip_cache 1;
}
if ($request_uri ~* "/(cart|checkout|my-account)/*$") {
set $skip_cache 1;
}
I will update the wordpress cache templates on next update to support WooCommerce.
Thanks
from nginx-more.
Hi Karl,
Thanks for that, I implemented it and it works perfectly.
Could you please let me know what is the best way to purge the cache by the terminal?
Visiting site_url/purge/ after putting my IP in /etc/nginx/conf.d/custom/admin-ips.conf is OK but I am looking for a more practical way that could also be used in a script.
Thank you very much.
from nginx-more.
Could you please let me know what is the best way to purge the cache by the terminal?
Add an alias such as: alias purge-nginx-cache="rm -rf /var/lib/nginx/cache/fastcgi/*"
Visiting site_url/purge/ after putting my IP in /etc/nginx/conf.d/custom/admin-ips.conf is OK but I am looking for a more practical way that could also be used in a script.
This plugin works well to clear single page cache after editing: https://en-ca.wordpress.org/plugins/nginx-helper/
Karl
from nginx-more.
Thanks Karl!
from nginx-more.
See commit 8434453.
from nginx-more.
Related Issues (20)
- My issue when installed on CentOS 7 HOT 3
- Nginx-more on Debian 10 - Not an issue, more of a question. HOT 3
- arm support HOT 4
- HTTP/3 HOT 7
- Rocky Linux HOT 2
- add the spec file for modsecurity-ngix HOT 1
- Bump to Nginx 1.21.4 HOT 1
- Enable kTLS HOT 4
- ModSecurity Module and Configuration
- Cannot configurable limit on depth of JSON parsing HOT 3
- Consider Updating HOT 4
- el9 support HOT 9
- SSL handshake failed
- nginx-more docker image HOT 4
- how can i enable TLSv1.0 and TLSv 1.1 on nginx-more-1.22? HOT 5
- Pagespeed Module Not Updated
- nginx-more-1.22.1-1.el8.x86_64 breaks ngx_cache_purge HOT 6
- Unable to build as public sources are not referenced in the spec file HOT 5
- NGINX-more v1.24 Stable Update HOT 12
- Support for Debian HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-more.