views:

49

answers:

2

I'm fairly new to memcache so apologies if this is an obvious one. I have looked through the memcached documentation and tried various Google searches but to no avail.

The setup :

  • Drupal 6.19
  • Memcache API and integration module
  • Authcache module
  • Centos 5
  • Memcached 1.2.6

If you need further information let me know.

The situation :

Memcache is certainly running, bins are being filled and page load times are incredible. However, I noticed only recently, when doing some testing that when I clicked on a link before the page had finished loading memcache stores the current page state in memory. So, when the next user comes along he sees a half formed page that I was too impatient to wait for.

Your response might be to sort out my page loading - which I'm looking in to. But I would like to solve this one as well. This means that if a user with a particularly slow connection is the first one to visit a page then he / she might click away and store an incomplete page for everyone else to see.

I appreciate any advice you can offer. Even if it is pointing me to an obvious resource I've overlooked.

Thank you

A: 

Are you sure this isn't a browser cache issue? This doesn't sound like a memcached issue at all unless you've got a weird setup.

bemace
During testing, I viewed the page originally in Firefox - this is when I clicked early before the page had finished loading. Then, I viewed the same page in Camino (Mac browser) and saw the same incomplete page. With Memcached turned off the problem doesn't exist.
mikeefreedom
Viewing the page in Safari, where it hasn't been opened before, has the same result.
mikeefreedom
@mikeefreedom I guess I'm not understanding how the $cache->set method would get called before the content was completely generated. It seems like if the page load is aborted, nothing would be set in the cache. Am I just misunderstanding what you're doing?
bemace
Maybe you had a server-side glitch in your php that caused an incomplete result which was then cached?
bemace
I will look again through the Drupal and Memcache API code to try and find when it is writing to the cache. I would have thought it should have generated the entire page before it serves it to the browser but I could be wrong.
mikeefreedom
A: 

Try ignore_user_abort(true); http://www.php.net/manual/en/function.ignore-user-abort.php

Petah