Answers.Body: <p>You can certainly try to set up rules to bypass the reverse proxy, but at the same time, I think it will be more cost-effective to change hosting.  Varnish problems aren't going to be the only issue you have when you have managed hosting that is specially tuned for WordPress hosting.</p>
  
  <p>CiviCRM and WordPress work nicely together because they rely on the same LAMP stack and it's valuable to have your CRM and website tightly integrated.  However, from another perspective, a CRM and a website have opposite performance needs.  A website needs to serve <em>the same few dozen pages</em> to thousands of visitors.  A CRM needs to pull from among <em>thousands of contacts' information</em> for a handful of users.</p>
  
  <p>Managed WordPress hosting (whether through Dreamhost, WP Engine, or others) attempts to maximize website performance by caching as much as possible so that the most commonly-visited pages can be delivered whole without querying the database.  This tilts the process completely towards the handful of content, lots of visitors use case for a website.</p>
  
  <p>For a CRM, there's the issue you're facing where you have to tell the reverse proxy to skip various pages and widgets that are driven by CiviCRM.  But when you fix that, at least for certain pages <em>you've defeated the performance tricks</em> that you're paying your host to implement.</p>
  
  <p>The entire business model of this kind of hosting is to rely on these tools to get maximum performance out of minimal hardware.  Without the caching, you're just left with cheap hosting.  That's not going to serve you well as you try to use CiviCRM.</p>
  
  <p>Your better bet is to host with something a little more substantial.  What my colleagues and I have recommended for years is a virtual private server (VPS or cloud server) with at least 4GB of RAM and a dual-core processor.  You can get these for around $20 per month at Linode, AWS, DigitalOcean, and elsewhere.  They require setting up the whole LAMP stack, but that's something lots of us who support CiviCRM can do.</p>
  
  <p>Once you've done this, you'll have better performance, a stack that is more broadly supported and used, and the ability to set up a practically unlimited number of development sites, extra domains, and so forth.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T19:17:38.980Z
Answers.Text: Andrew gave a really good answer - however, I will share that there are good shared hosts out there, some of which are CiviCRM contributors and partners, that offer great shared hosting services. 
  
  As Andrew pointed out however, I would not use managed Wordpress hosting and the 4.6 line of Civi or LTS may not have a future after 2018. https://civicrm.org/blog/jackrabbithanna/why-civicrm-long-term-support-lts-is-important
Answers.UserDisplayName: themak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T16:06:48.990Z
Answers.LastActivityDate: 2018-06-11T16:06:48.990Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>Just thought I'd follow up on this and let folks know where I wound up -- after a lot of research and some outside assistance it turns out that it was actually the photo slider plugin (Slider Revolution) I was using on our homepage that was causing CiviCRM to break, and switching to Meta Slider fixed that issue. We also discovered that Varnish might have taken some tweaking as well to make sure everything worked correctly, so I wound up moving the site from DreamPress over to Amazon Lightsail, and I'm really happy with Lightsail.</p>
  
  <p>Thanks to everyone for all the help thinking through this!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-02T01:23:40.263Z
Answers.LastActivityDate: 2018-08-02T01:23:40.263Z
Answers.UserDisplayName: Matt Woodward
Answers.Body: <p>I don't think using an older version makes sense but I would give serious consideration to changing your hosting. In general using a host that does not support CiviCRM well can be quite expensive and there are several providers that do specialise in CiviCRM hosting</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-09T00:46:39.940Z
Answers.LastActivityDate: 2018-06-09T00:46:39.940Z
Answers.UserDisplayName: user4278
Body: <p>I'm brand-new to CiviCRM and really appreciate all the amazing work that's been done on this project!</p>
  
  <p>I've been working on our implementation on a test server for a while now, but when I started implementing things on our production server, which is managed WordPress on Dreamhost (DreamPress), I'm running into issue related to modsecurity and Varnish cache I was hoping someone could help with.</p>
  
  <p>For one example of the issue, I created a new contribution page and the test drive link works fine, but when I try to go to the live page () I get this error (throwing Xs in for a couple of values):</p>
  
  <pre><code>[Tue Jun 05 16:24:46 2018] [error] [client XXX.XXX.XXX.XXX] ModSecurity: Error reading request body: Partial results are valid but processing is incomplete [hostname "kptz.org"] [uri "/wp-admin/admin-ajax.php"] [unique_id "XXXXXXXXXXXXXXXXXX"]
  </code></pre>
  
  <p>I emailed Dreamhost support and their response was "... the plugin is using PHP sessions and setting session cookies that are conflicting with the Varnish cache. The cookies are setting 'no-cache' parameters, which are
  preventing Varnish from caching the site successfully. Previously, the
  plugin developers had posted in the forums regarding fixing the use of
  cookies for previous versions of the civicrm plugin. You can contact the
  developers and ask if the use of cookies can be adjusted for version
  5.1.2 of the plugin."</p>
  
  <p>They also said that they can add Varnish rules to my setup if they know what to add.</p>
  
  <p>I suppose my first question is would I be better off using CiviCRM 4.6.36, i.e. is this something that is not an issue in the older version? If using the older version won't help, is there any guidance as to how to address this issue, or any sample Varnish rules available?</p>
  
  <p>Thanks in advance for any assistance anyone can provide, and thanks again for CiviCRM!</p>
  
Tags: <wordpress><error><cache>
Title: 500 Errors on CiviCRM 5.1.2 with Varnish on WordPress
ThreadText: # 500 Errors on CiviCRM 5.1.2 with Varnish on WordPress
  
  (Asked by: username_0 on 2018-06-05)
  
  I'm brand-new to CiviCRM and really appreciate all the amazing work that's been done on this project!
  
  I've been working on our implementation on a test server for a while now, but when I started implementing things on our production server, which is managed WordPress on Dreamhost (DreamPress), I'm running into issue related to modsecurity and Varnish cache I was hoping someone could help with.
  
  For one example of the issue, I created a new contribution page and the test drive link works fine, but when I try to go to the live page () I get this error (throwing Xs in for a couple of values):
  
  ```
  [Tue Jun 05 16:24:46 2018] [error] [client XXX.XXX.XXX.XXX] ModSecurity: Error reading request body: Partial results are valid but processing is incomplete [hostname "kptz.org"] [uri "/wp-admin/admin-ajax.php"] [unique_id "XXXXXXXXXXXXXXXXXX"]
  
  ```
  
  I emailed Dreamhost support and their response was "... the plugin is using PHP sessions and setting session cookies that are conflicting with the Varnish cache. The cookies are setting 'no-cache' parameters, which are
  preventing Varnish from caching the site successfully. Previously, the
  plugin developers had posted in the forums regarding fixing the use of
  cookies for previous versions of the civicrm plugin. You can contact the
  developers and ask if the use of cookies can be adjusted for version
  5.1.2 of the plugin."
  
  They also said that they can add Varnish rules to my setup if they know what to add.
  
  I suppose my first question is would I be better off using CiviCRM 4.6.36, i.e. is this something that is not an issue in the older version? If using the older version won't help, is there any guidance as to how to address this issue, or any sample Varnish rules available?
  
  Thanks in advance for any assistance anyone can provide, and thanks again for CiviCRM!
  
  **Tags:** wordpress, error, cache
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2018-06-11. Score: 1 | Accepted answer
  
  You can certainly try to set up rules to bypass the reverse proxy, but at the same time, I think it will be more cost-effective to change hosting. Varnish problems aren't going to be the only issue you have when you have managed hosting that is specially tuned for WordPress hosting.
  
  CiviCRM and WordPress work nicely together because they rely on the same LAMP stack and it's valuable to have your CRM and website tightly integrated. However, from another perspective, a CRM and a website have opposite performance needs. A website needs to serve *the same few dozen pages* to thousands of visitors. A CRM needs to pull from among *thousands of contacts' information* for a handful of users.
  
  Managed WordPress hosting (whether through Dreamhost, WP Engine, or others) attempts to maximize website performance by caching as much as possible so that the most commonly-visited pages can be delivered whole without querying the database. This tilts the process completely towards the handful of content, lots of visitors use case for a website.
  
  For a CRM, there's the issue you're facing where you have to tell the reverse proxy to skip various pages and widgets that are driven by CiviCRM. But when you fix that, at least for certain pages *you've defeated the performance tricks* that you're paying your host to implement.
  
  The entire business model of this kind of hosting is to rely on these tools to get maximum performance out of minimal hardware. Without the caching, you're just left with cheap hosting. That's not going to serve you well as you try to use CiviCRM.
  
  Your better bet is to host with something a little more substantial. What my colleagues and I have recommended for years is a virtual private server (VPS or cloud server) with at least 4GB of RAM and a dual-core processor. You can get these for around $20 per month at Linode, AWS, DigitalOcean, and elsewhere. They require setting up the whole LAMP stack, but that's something lots of us who support CiviCRM can do.
  
  Once you've done this, you'll have better performance, a stack that is more broadly supported and used, and the ability to set up a practically unlimited number of development sites, extra domains, and so forth.
  
  > **Comments:**
  > **username_2**: Andrew gave a really good answer - however, I will share that there are good shared hosts out there, some of which are CiviCRM contributors and partners, that offer great shared hosting services.   As Andrew pointed out however, I would not use managed Wordpress hosting and the 4.6 line of Civi or LTS may not have a future after 2018. https://civicrm.org/blog/jackrabbithanna/why-civicrm-long-term-support-lts-is-important  
  
  ---
  
  ### Answer by username_0 on 2018-08-02. Score: 1
  
  Just thought I'd follow up on this and let folks know where I wound up -- after a lot of research and some outside assistance it turns out that it was actually the photo slider plugin (Slider Revolution) I was using on our homepage that was causing CiviCRM to break, and switching to Meta Slider fixed that issue. We also discovered that Varnish might have taken some tweaking as well to make sure everything worked correctly, so I wound up moving the site from DreamPress over to Amazon Lightsail, and I'm really happy with Lightsail.
  
  Thanks to everyone for all the help thinking through this!
  
  
  ---
  
  ### Answer by username_3 on 2018-06-09. Score: 0
  
  I don't think using an older version makes sense but I would give serious consideration to changing your hosting. In general using a host that does not support CiviCRM well can be quite expensive and there are several providers that do specialise in CiviCRM hosting
  
  
  ---
  
  