My problem is that all cached pages appear blank in most browsers, or a string of garbage characters in Konqueror. The problem is the same as described here: http://drupal.org/node/59243. The solutions described on that page either do not work (i.e. increase memory limit) or are not acceptable (i.e. disable cache).

I believe the problem is that the gzipped data being stored in the cache table is bogus. But I don't quite know how to prove that. I wouldn't be surprised if this is a side effect of some system configuration on my host, and this may be difficult for others to reproduce. My host in this case is nearlyfreespeach.net.

Here is an export of one row from my cache, where the gzipped data field is encoded:

INSERT INTO `cache` (`cid`, `data`, `expire`, `created`, `headers`) VALUES ('http://example.com/demo/my_site/?q=user', 0x1f3f08000000000000033f576d6f3f36103f3f5f3f3f3f0a0c3f1927483f3f3f3f264d3f603f3f1b3f3f3f253f62423f0a493f493f1f3f3b523f3f3f3f3f33103f123f1e3f3d3c3e3f3f5e3f391d7e3f3a233f2b143f7a777279714a683f3f3f533f5e0c5f3f3f3f3f3f2f493f3f4b3f3a23533f3f3f6f3f3f3f3f3f7c3f3f3f3f3f3f3f1f3f0e513f3f3f0c233f7d7a3f3f3f603f10123f753f0a553f6403463f3f3f283f3f60743c4b686d3f633f3f3f3f362a646a3f3f13173f3f383f3f3f3f3f343f3f3f1e3f3f3f4e3f0b3f3f3f4e3f416d3f213c4d755d3a3f3739513f3f3f2c3f55211c271853246e6b090b3f3f3f3f456f3f123f3f3f123f3f3f5d423f3f732c3f3f123f653f4d7e3f3f533f3f3f583f3f3f4d3f433f135b5c3f38703f3f503f4c3f3f723f3f3f1759543f384259260a3f4d59213f2b33753f550f3f3f3f3f3f0c623f1a593f2e3f353f3f3f3f126b3f640b3f3f03403f3f183f373f3f3f56b2693f2b3f3f053f353500563f373f7a3f440f763f3f3f3f4825125e3f78513d3f257b3f3f033f3f373f3e797e3f3f3f733f3f3f3f3f4723553f5f3f0d3f3f3f3f3f3f523f3f193e3f3f3f3f3c1c3f7a7b723f3f3f3f276b6f3f3f4c766f3f3f3f39197e7e5d3f3f3f3f673f543f3f3f397f7735773f3f3f46724e3f3f3f3f643f4c5a073f64223f3f3f3f3d151a0a70263f3f3f463f3f51703f6c5e3f5b1b3f473f3f3f433f586f3f112a3f363f3f4f6b47243f14253f113f3f5d3f3f193f3f3f3f3f48167c2a3f5d143f423f3f3f6a5b3f3f07353f3d3f4a3f3f495d2e063f123c13333f3f3f3f3f7520493f0a3f7e3f79003f3f3f633f3f133f757c0c3f3f2c790c3f2314042e4b611e0f62673f2f23333f3f3f4c3f3f3f55013f5d3f3f383f333f3f082c4c5054124f3f29403f3f6e213c3f4d3f3f263f59096548093f3f720d3f3f503f3f133f473e3f113f3f3f603f523f003f523f622f3f3f64091529683f6c6611213f4e200c3f65593f3f53027c3f3b253f3f133f3f033f2b790173403f3f732d3f113f713f5708132d3f3f163f3f3f3f013f7f403f3f1a3f503f3f3f093d033f35043c083f163f3f3f3f3f3f3f243f11003f3f3f433f3f3f0c3f3f593f3f3f3f423f36725d2d3f7c3f3f3f023f5a3f07283f3f323f573f3f7d42325b4f383f09477e733f3f3f3f74033f3f31c93f423f3f4a2c383f283371473f401b602f65317d283f3f22577a3f7b55393f3f2b3f643f3f3f3f3f3f753f5a793f140e3f413f09023f572e3f34643f273f3f413f152f3f3f163f3f3f3f5f0a47383f224a3f3f373f3b3f61434a3f41320e603f3f30363f2a564060673f3f475144443f3f703f4814753f1a3f463f63463f3f5a3f3f3f0145353f7419283f293f295b383f7804597f3f36246b3f3f0a723f0b3f500a1b3f063f653f565e3ff63f353f15103f3f2668786d3f4e4b6f3f265d3f3f3f3f3f473f3f233f49603f3f7b3f233f3f3e723f723f3f7d3f3f3f3f40013f1a14083f256540543b3f3f353f5c253f1b2e471f3f420510592e193f4e3b3f33233f3f512f3f3f573f563f3f5c3f0c5d6f6b611d143f3f6f3b303f5e3f7e3f3f493f383f1c3f3f3f3f6b733f660c393f4c7f3f1f604e3f023f412a3f3f0d3f3f7843773f3f11702d3f3f3f513f151f0b3f6a3f57383f3f0001473f3f213f3f223f3f6c71263f3f3f64223f3f080c3f3f1e1d3f3f1c633f1a573f3f3f3f6477455a713f3f551f5a3f363f773f6d3f3f253f11743f3f3f403f013f3f3f4b053f3f3f693f261d3f3f3f3f3f0b1a3f1b127a2b3f3f3f3f5c623f3f3f5553743f2b3f3f7a3f3f3f3f265a743f3f3f753f3f3f3f2c623f6e433f071078543f4631033f3f3f3f3f7e3f4851283f3f243a273f3f753f3f773f4b2f4f2b4c3f3f6d173f073f7a3f3a077a3f3f3f3f7641602e0b3f0c4d4e3f2c603f20453f3f747a3f446b3f3f4f3f593f463f3f783f60143f3f423b016f093f3f3f3f3f3f3f2d3f3f0f540c483f5e100000, -1, 1163623256, 'Content-Type: text/html; charset=utf-8');

When I visit the cached page, in this case ?q=user, the effect depends on the browser used. Most browsers show a blank page, with no errors reported on the client or server logs. Konqueror shows some garbage characters. (Oh Konqueror, what would we do without you?). And weak-ass browsers that don't support gzipped HTML cause an error to appear, something like:

Warning:  gzinflate() [function.gzinflate]: data error in /nfsn/content/my_account/htdocs/demo/my_site/includes/bootstrap.inc on line 543

I've tried clearing my cache. This causes the page to be displayed fine the next time it is requested. However the bogus data is again written to the cache table. And the error returns the next time the page is requested.

I would appreciate any help on this. If further info is needed just let me know.

Comments

Dave Cohen’s picture

Still trying to track this down...

I introduced some code to page_set_cache() for debugging. After the call to cache_set(), I immidiately call cache_get() with the same cid. The result is that the data returned from cache_get is not identical to the data passed into cache_set.

I suspected db_decode_blob might be the problem. cache_get calls it, but cache_set never calls db_encode_blob. But I looked at the mysql definition of db_decode_blob and it does nothing, so that is probably not the issue.

I'll post again if I learn more. For now I am stymied.

webchick’s picture

I think, but am not positive, that this is a duplicate of http://drupal.org/node/43462

t4him’s picture

Tagging to track this bug. I have the same

Dave Cohen’s picture

Webchick, I think it is not a duplicate, as I am able to reproduce this bug using just one browser. The problem occurs all the time on one of my hosts, but not others (as far as I know).

falk_g’s picture

Version: 4.7.x-dev » 5.7

Has this ever been fixed or the source of it found? Because I have a 5.x intallation and get the exact same problem and just can´t figure it out. garbage in safari, blank pages everwhere else - only cached pages are affected. Turning off caching gets rid of it but not an option as drupal is slow as a duck already and slows to a snail with caching off.

falk_g’s picture

Has this ever been fixed or the source of it found? Because I have a 5.x intallation and get the exact same problem and just can´t figure it out. garbage in safari, blank pages everwhere else - only cached pages are affected. Turning off caching gets rid of it but not an option as drupal is slow as a duck already and slows to a snail with caching off.

sivaji_ganesh_jojodae’s picture

Version: 5.7 » 6.x-dev
Status: Active » Closed (works as designed)

This is by design. I had the same problem in my d6 site.

In the performance page admin/settings/performance read the page compression description.

By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression.

I guess web server is trying to compress page which is already compressed by drupal. Disabling drupal page compression solved this problem for me.