Website Strange Data Delay

Hi,

I have a website I’m working on staging.environmentcelebration.nlott.com using bedrock/trellis and I’ve been noticing there is a strange delay that’s happens.

I’m using woocommerce and If I add/remove items into my shopping cart sometime they don’t show up or get removed right away.

I’m also noticing this also when I’m developing and updating php files directly on this staging site that sometimes when I refresh my browser the changes aren’t appearing.

I’ve experimented both with having the cache enabled and cache disabled. I’ve experimented with clearing the caches.

Does anyone have any experience with this and I’m not sure how to troubleshoot? I’m using wordpress 4.8.2.

My clear cache command:

ansible "web:&staging" -m command -a "composer clear-cache" -u web

My wordpress_sites.yml

branch: master
multisite:
 enabled: false
ssl:
 enabled: true
 provider: letsencrypt
cache:
 enabled: false

I’m willing to hire someone to troubleshoot this.

Are you running any caching plug-ins on your site? Or caching services? Who is your host?

My host is digital ocean. Its a 1GB Ram / 30 GB Disk Ubuntu 16.04.

There are no caching plugins directly installed in Wordpress. Here are all my plugins installed:

Query Monitor by John Blackbourn – 2.15.0
Excel to LearnDash by http://www.wppluginsforyou.com – 3.4
Add From Server by Dion Hulse – 3.3.3
Akismet Anti-Spam by Automattic – 4.0
Auto Subpage Menu by Nathachai Thongniran – 1.1.5
Better Notifications for WordPress by Made with Fuel – 1.6.7
Content Views by CVSOFT LLC – 1.9.9.3
Content Views Pro by CVSOFT Ltd – 4.7.4
Custom Post Type UI by WebDevStudios – 1.5.5
CPT Layout Injector by Sean Barton - Tortoise IT – 3.5
Easy Media Download by naa986 – 1.1.2
Enable Media Replace by Måns Jonasson – 3.1.1
Free Responsive iframe Video Embeds by iPlayerHD – 1.0.4
Jetpack by WordPress.com by Automattic – 5.3
LearnDash Course Grid by LearnDash – 1.4.1
LearnDash LMS - Notifications by LearnDash – 1.0
LearnDash ProPanel by LearnDash – 2.1.0
LearnDash WooCommerce Integration by LearnDash – 1.4.0 – Not tested with the active version of WooCommerce
LearnDash LMS by LearnDash – 2.4.7
LearnDash Zapier by LearnDash – 1.1.0
LoginPress - Customizing the WordPress Login by WPBrigade – 1.0.22
Multiple Roles by Florian TIAR – 1.2.0
Nav Menu Roles by Kathy Darling – 1.8.6
Ninja Forms - Conditional Logic by The WP Ninjas – 3.0.17
Ninja Forms - Mail Chimp by The WP Ninjas – 3.0.4
Ninja Forms - File Uploads by The WP Ninjas – 3.0.15
Ninja Forms by The WP Ninjas – 3.2.1
PayPal for WooCommerce by Angell EYE – 1.4.6.8 – Not tested with the active version of WooCommerce
PayPal IPN for WordPress by Angell EYE – 1.1.2
Popup Maker by WP Popup Maker – 1.6.6
Post Snippets by David de Boer – 2.5.3
Query Recorder by Delicious Brains – 1.0.1
Regenerate Thumbnails by Alex Mills (Viper007Bond) – 2.3.1
Server IP & Memory Usage Display by Apasionados, Apasionados del Marketing – 2.0.3
Simple Lightbox by Archetyped – 2.6.0
Transients Manager by Pippin Williamson – 1.7.3
Uncanny LearnDash Toolkit by www.uncannyowl.com – 2.1
Uncanny LearnDash Toolkit Pro by Uncanny Owl – 2.1.7
Users Insights by Pexeto – 3.3.0
Advanced Messages for WooCommerce by Jeroen Sormani – 1.2.0 – Not tested with the active version of WooCommerce
WooCommerce Advanced Shipping Packages by WooCommerce – 1.1.4 – Not tested with the active version of WooCommerce
WooCommerce Conditional Shipping and Payments by SomewhereWarm – 1.2.9 – Not tested with the active version of WooCommerce
WooCommerce Products Visibility by codemine – 2.4 – Not tested with the active version of WooCommerce
WooCommerce FedEx Shipping by WooCommerce – 3.4.9 – Not tested with the active version of WooCommerce
WooCommerce USPS Shipping by WooCommerce – 4.4.10 – Not tested with the active version of WooCommerce
WooCommerce - ShipStation Integration by WooCommerce – 4.1.18 – Not tested with the active version of WooCommerce
WooCommerce by Automattic – 3.2.5
WP LESS by Oncle Tom – 1.8.0
WP-Mail-SMTP by WPForms – 0.10.1
WP Migrate DB Pro CLI by Delicious Brains – 1.3
WP Migrate DB Pro by Delicious Brains – 1.7.2
WP-Sweep by Lester ‘GaMerZ’ Chan – 1.0.10
Custom Product Tabs for WooCommerce by YIKES, Inc – 1.5.17 – Not tested with the active version of WooCommerce

Doesn’t Jetpack include some basic caching? And you’re not using CloudFlare or anything like that?

Jetpack is disabled and I’m not using cloudfare to my knowledge.

You showed that you have caching disabled in wordpress_sites.yml; was it ever enabled? Did you reprovision your server after setting it to disabled? Deploying and provisioning are different things.

Thanks for the clarification – it was enabled – its actually enabled on my production instance which is showing the same behavior.

I may have only deployed. How do I reprovision?

cd $ECI_WORKING_DIR/trellis
ansible "web:&staging" -m command -a "composer clear-cache" -u web
ansible-playbook deploy.yml -e env=staging -e site=environmentcelebration.com -e 'project_copy_folders=[]'

Provisioning is the “Remote Server” part of the docs, here: https://roots.io/trellis/docs/remote-server-setup/

The command you want is ansible-playbook server.yml -e env=<environment>

Where <environment> is “production” or “staging”.

If I provision it – will it be nuked though and then I need to go through the deploy and updating the DB process?

No, it’s safe to reprovision a live site. Try it on staging first, obviously, but you should be fine.

Interesting – I think it might have fixed it – do you normally use caching for your site in the wordpress_sites.yml? What’s the normal strategy everyone is using?

I often turn on caching. My clients don’t tend to update their content often enough, or with enough urgency, that a cache will cause an issue.

Hi – I’m still having this problem – caching is off and when I make a php file update in one of my plugins its not updating – there’s probably a 30 second - 1 minute delay and then the change appears. If someone is willing to help troubleshoot – I’m happy to pay them.

I’ve updated my nginx so it disables caching – and I’m still seeing the same problem.

~/work/websites/environmentcelebration.com/trellis[master] $ curl -I http://staging.environmentcelebration.nlott.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 11 Dec 2017 19:30:30 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://staging.environmentcelebration.nlott.com/
Last-Modified: Monday, 11-Dec-2017 19:30:30 GMT
Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0

Please note that you are not clearing nginx cache you are clearing COMPOSER cache, two completely different things.

I recommend NOT turning cache on for staging at all, also when you DO for production, make sure you remove woocommerce cart pages or else you will be showing users other users’ cart contents!

1 Like

This is a very good tip. I wonder if this is important enough to roll into Trellis, considering how important to the WP ecosystem Woo is?

https://roots.io/trellis/docs/fastcgi-caching/#example-cache-configurations has both WooCommerce and EDD examples

Maybe we should add a comment above the cache section in wordpress_sites.yml with a link to that?

Maybe. Or I could be better at reviewing the docs more often :slight_smile: