31 public function write($content, $md5)
34 if ($this->compression)
37 $content = gzencode($content, 4);
40 if (!$this->memcached || !$this->memcached->set($this->cacheKey, $content, $flags))
45 $this->props = new \stdClass();
46 $this->props->mtime = time();
47 $this->props->etag = md5($this->cacheKey.$this->props->size.$this->props->mtime);
48 $this->props->type =
"text/html; charset=".LANG_CHARSET;
49 $this->props->md5 = $md5;
50 $this->props->gzip = $this->compression;
52 $this->props->size = strlen($content);
53 $this->props->size += strlen(serialize($this->props));
55 $this->memcached->set(
"~".$this->cacheKey, $this->props);
57 return $this->props->size;