Answers.Body: <p>I had this error. Changing the allow_max_packet did not work. Turns out it was my general.db file. I have it set up for a multi-environment config. This is what fixed it:</p>
  
  <p>Changing</p>
  
  <pre><code>    '*' =&gt; array(
           'defaultImageQuality' =&gt; 80,
      ),
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>    'defaultImageQuality' =&gt; 80,
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-10T10:35:40.327Z
Answers.Text: This doesn't make sense? Do you know why the multi-environment config caused it? Have you talked to P&T about it?
Answers.UserDisplayName: Fred Carlsen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T00:20:53.803Z
Answers.LastActivityDate: 2015-12-09T00:20:53.803Z
Answers.UserDisplayName: SteveO
Answers.Body: <p>So turns out this is to do with the size of the packet being sent to the database cache.</p>
  
  <p>My server had a limit of: 
  max_allowed_packet = 1M</p>
  
  <p>Doubling this solved my problem.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-08T11:04:20.500Z
Answers.LastActivityDate: 2015-08-08T11:04:20.500Z
Answers.UserDisplayName: j00lz
Body: <p>I have a includeJS variable set that populates a javascript calendar from an entries loop, with a large amount of entries which needs to be cached. </p>
  
  <p>Whenever I cache this section I get this error:</p>
  
  <p><code>Error while sending QUERY packet. PID=11878</code></p>
  
  <p>What's the problem here?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-07T17:08:00.313Z
Comments.Text: `cache` is useless if the thing you're caching doesn't directly output HTML. Instead of using `includeJs`, perhaps it makes sense to output a `<script>` tag, and cache that.
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-08T10:40:58.397Z
Comments.Text: When I use the script tag I still get the same QUERY packet error
Comments.UserDisplayName: j00lz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-08T10:52:54.287Z
Comments.Text: I've narrowed this down now.... seems there is a limit to the size of a cached object.
  
  If I try to cache a loop of 200 entries then it gives me the php warning.
  
  Is it possible to up this limit?
Comments.UserDisplayName: j00lz
Tags: <cache>
Title: Error while sending QUERY packet
ThreadText: # Error while sending QUERY packet
  
  (Asked by: username_0 on 2015-08-07)
  
  I have a includeJS variable set that populates a javascript calendar from an entries loop, with a large amount of entries which needs to be cached.
  
  Whenever I cache this section I get this error:
  
  `Error while sending QUERY packet. PID=11878`
  
  What's the problem here?
  
  **Tags:** cache
  
  > **Comments:**
  > **username_1**: `cache` is useless if the thing you're caching doesn't directly output HTML. Instead of using `includeJs`, perhaps it makes sense to output a `<script>` tag, and cache that.  
  > **username_0**: When I use the script tag I still get the same QUERY packet error  
  > **username_0**: I've narrowed this down now.... seems there is a limit to the size of a cached object.  If I try to cache a loop of 200 entries then it gives me the php warning.  Is it possible to up this limit?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-08-08. Score: 4 | Accepted answer
  
  So turns out this is to do with the size of the packet being sent to the database cache.
  
  My server had a limit of:
  max\_allowed\_packet = 1M
  
  Doubling this solved my problem.
  
  
  ---
  
  ### Answer by username_2 on 2015-12-09. Score: 0
  
  I had this error. Changing the allow\_max\_packet did not work. Turns out it was my general.db file. I have it set up for a multi-environment config. This is what fixed it:
  
  Changing
  
  ```
      '*' => array(
           'defaultImageQuality' => 80,
      ),
  
  ```
  
  to this:
  
  ```
      'defaultImageQuality' => 80,
  
  ```
  
  > **Comments:**
  > **username_3**: This doesn't make sense? Do you know why the multi-environment config caused it? Have you talked to P&T about it?  
  
  ---
  
  