<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>

CC BY-SA 3.0
2016-11-10T10:35:40.327Z
This doesn't make sense? Do you know why the multi-environment config caused it? Have you talked to P&T about it?
Fred Carlsen
CC BY-SA 3.0
2015-12-09T00:20:53.803Z
2015-12-09T00:20:53.803Z
SteveO
<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>

CC BY-SA 3.0
2015-08-08T11:04:20.500Z
2015-08-08T11:04:20.500Z
j00lz
<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>

CC BY-SA 3.0
2015-08-07T17:08:00.313Z
`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.
Lindsey D
CC BY-SA 3.0
2015-08-08T10:40:58.397Z
When I use the script tag I still get the same QUERY packet error
j00lz
CC BY-SA 3.0
2015-08-08T10:52:54.287Z
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?
j00lz
<cache>
Error while sending QUERY packet
# 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?  

---

