<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 06:23:57 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: APC: get a key's expiration time]]></title>
      <guid>http://www.phpdeveloper.org/news/15417</guid>
      <link>http://www.phpdeveloper.org/news/15417</link>
      <description><![CDATA[<p>
<i>Till Klampaeckel</i> has shown off one of the "best kept secrets" about the APC caching tool that not many people seem to use - <a href="http://till.klampaeckel.de/blog/archives/124-APC-get-a-keys-expiration-time.html">getting a key's expiration time</a> that can be useful to tell other applications how long the data will be good for.
</p>
<blockquote>
APC offers a bunch of very useful features - foremost a realpath cache and an opcode cache. However, my favorite is neither: it's being able to cache data in shared memory. How so? Simple: use apc_store() and apc_fetch() to persist data between requests. The other day, I wanted use a key's expiration date to send the appropriate headers (Expires and Last-Modified) to the client, but it didn't seem like APC supports this out of the box yet.
</blockquote>
<p>
He includes a quick bit of sample code that defines an "apc_exire" function that grabs the expiration information as returned by apc_cache_info - the "ttl" and "creation_time" values.
</p>]]></description>
      <pubDate>Thu, 11 Nov 2010 11:28:55 -0600</pubDate>
    </item>
  </channel>
</rss>
