Skip to content

Instantly share code, notes, and snippets.

@sbisbee
Created March 18, 2012 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbisbee/2066902 to your computer and use it in GitHub Desktop.
Save sbisbee/2066902 to your computer and use it in GitHub Desktop.
<?php
$response = new StdClass();
$response->body = new StdClass();
$response->body->foo = "bar";
$response->headers = new StdClass();
$response->headers->Etag = "\"asdfasfsadfsadf\"";
$cache = new SagMemoryCache();
sample();
for($i = 1; $i &lt;= 100000; $i++)
$cache->set("$i", $response);
sample();
?>
<?php
$sag->setCache(new SagMemoryCache());
$response = $sag->get($url);
$response->body->name= "Joe"; //shouldn't update cached response
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment