Disable Cache while developing

Just starting to have a play with a wp site setup with nginx fastcgi_cache wondering what the suggested way to disable/bypass the cache while developing?

I tried turning on the checkboxes in the nginx helper settings page, but my pages, after edits to the page, seem to still be cached so in order to see the result of my changes i have to click the BIG RED button each time.

Unless I hear otherwise, I am thinking the best approach to turning off caching (wpfc) for a period of time where a lot of live dev work is needed, is to simply edit the nginx config and restart the service:

#include common/wpfc.conf;
include common/php.conf;

Please let me know if there is better suggested way.

I guess I was wrong. That adjustment to the nginx configs does not seem to prevent caching. Odd.

@datagroove, It seems that you did not disable w3 Total cache, which is responsible for database and object cacheing in case of EasyEngine wpfc setup.

@harshadyeola, thanks for the feedback, I did not setup w3 total cache to do any caching (and I think by default it does not).

The error I made was that I just forgot to also comment out the wpfc.conf from my ssl server block that i added below the 80 block.

So I am back to the conclusion that commenting out the wpfc configs and replacing with php is the preferred way, as it is workign for me as intended now…please let me know if there is a more preferred way…

#include common/wpfc.conf;
include common/php.conf;

@datagroove, Just small update, also change this # WPSINGLE FAST CGI NGINX CONFIGURATION to # WPSINGLE BASIC NGINX CONFIGURATION in your nginx conf.

Glad to know that you made it work.

@datagroove if you are using wpfc, then during development, you can disable cache for all user by simply changing one line: https://github.com/rtCamp/easyengine/blob/master/config/nginx/common/wpfc.conf#L4

Change set $skip_cache 0;

To set $skip_cache 1;

If you want to skip cache for yourself only, you can add add a conditional skip block for fixed-ip (if you have static IP) like this - https://github.com/rtCamp/easyengine/blob/master/config/nginx/common/wpfc.conf#L20-23

If you do not have static IP, you can create a new cookie in your local browser (for example, using Edit-This Cookie in Chrome), and then add that cookie to the line: https://github.com/rtCamp/easyengine/blob/master/config/nginx/common/wpfc.conf#L21

One more way is to quickly add a test comment on a post or login to WordPress dashboard. In both cases, nginx-cache gets bypassed.

By the way, database and object-cache from W3 Total Cache generally do not interfere with output. In most cases, it’s HTML/CSS/JS changes which we are interested in seeing.

3 Likes

Awesome, thanks for the heads up @rahul286, maybe a wiki page for this?

1 Like

Yep. You can add a wiki page here - https://github.com/rtCamp/easyengine/wiki

We will be adding our documentation soon.

@rahul286 - does this disable the Zend Opcache?

I found an article with a suggested development mode APC configuration to prevent choking wordpress and causing other clashes … http://gregrickaby.com/the-perfect-apc-configuration/ … can this be applied the same way to Zend?

Cheers and thanks for your help!

@mattylb,

This does not disable Zend Opcache. If you want to disable zend opcache then do following settings:

vim /etc/php5/fpm/conf.d/05-opcache.ini

and comment the following line.

; zend_extension=opcache.so

and restart php5-fpm.

service php5-fpm restart

Hi @datagroove

It’s been a long time, and we haven’t heard from you. It looks like your issue is resolved.

I am closing this support topic for now. Feel free to create a new support topic if you have any queries further. :slight_smile: