• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3<head>
4<link rel="STYLESHEET" href="ref.css" type='text/css' />
5<link rel="first" href="ref.html" title='The httplib2 Library' />
6<link rel='contents' href='contents.html' title="Contents" />
7<link rel='last' href='about.html' title='About this document...' />
8<link rel='help' href='about.html' title='About this document...' />
9<link rel="next" href="response-objects.html" />
10<link rel="prev" href="http-objects.html" />
11<link rel="parent" href="module-httplib2.html" />
12<link rel="next" href="response-objects.html" />
13<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
14<meta name='aesop' content='information' />
15<title>1.1.2 Cache Objects</title>
16</head>
17<body>
18<div class="navigation">
19<div id='top-navigation-panel' xml:id='top-navigation-panel'>
20<table align="center" width="100%" cellpadding="0" cellspacing="2">
21<tr>
22<td class='online-navigation'><a rel="prev" title="1.1.1 http Objects"
23  href="http-objects.html"><img src='previous.png'
24  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
25<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
26  href="module-httplib2.html"><img src='up.png'
27  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
28<td class='online-navigation'><a rel="next" title="1.1.3 response Objects"
29  href="response-objects.html"><img src='next.png'
30  border='0' height='32'  alt='Next Page' width='32' /></a></td>
31<td align="center" width="100%">The httplib2 Library</td>
32<td class='online-navigation'><a rel="contents" title="Table of Contents"
33  href="contents.html"><img src='contents.png'
34  border='0' height='32'  alt='Contents' width='32' /></a></td>
35<td class='online-navigation'><img src='blank.png'
36  border='0' height='32'  alt='' width='32' /></td>
37<td class='online-navigation'><img src='blank.png'
38  border='0' height='32'  alt='' width='32' /></td>
39</tr></table>
40<div class='online-navigation'>
41<b class="navlabel">Previous:</b>
42<a class="sectref" rel="prev" href="http-objects.html">1.1.1 Http Objects</a>
43<b class="navlabel">Up:</b>
44<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
45<b class="navlabel">Next:</b>
46<a class="sectref" rel="next" href="response-objects.html">1.1.3 Response Objects</a>
47</div>
48<hr /></div>
49</div>
50<!--End of Navigation Panel-->
51
52<h2><a name="SECTION002120000000000000000"></a>
53<a name="cache-objects"></a>
54<br>
551.1.2 Cache Objects
56</h2>
57
58<p>
59If you wish to supply your own caching implementation
60then you will need to pass in an object that supports the
61following methods. Note that the <tt class="module">memcache</tt> module
62supports this interface natively.
63
64<p>
65<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
66  <td><nobr><b><tt id='l2h-23' xml:id='l2h-23' class="method">get</tt></b>(</nobr></td>
67  <td><var>key</var>)</td></tr></table></dt>
68<dd>
69Takes a string <var>key</var> and returns the value as a string.
70</dl>
71
72<p>
73<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
74  <td><nobr><b><tt id='l2h-24' xml:id='l2h-24' class="method">set</tt></b>(</nobr></td>
75  <td><var>key, value</var>)</td></tr></table></dt>
76<dd>
77Takes a string <var>key</var> and <var>value</var> and stores it in the cache.
78</dl>
79
80<p>
81<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
82  <td><nobr><b><tt id='l2h-25' xml:id='l2h-25' class="method">delete</tt></b>(</nobr></td>
83  <td><var>key</var>)</td></tr></table></dt>
84<dd>
85Deletes the cached value stored at <var>key</var>. The value
86of <var>key</var> is a string.
87</dl>
88
89<p>
90
91<div class="navigation">
92<div class='online-navigation'>
93<p></p><hr />
94<table align="center" width="100%" cellpadding="0" cellspacing="2">
95<tr>
96<td class='online-navigation'><a rel="prev" title="1.1.1 http Objects"
97  href="http-objects.html"><img src='previous.png'
98  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
99<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
100  href="module-httplib2.html"><img src='up.png'
101  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
102<td class='online-navigation'><a rel="next" title="1.1.3 response Objects"
103  href="response-objects.html"><img src='next.png'
104  border='0' height='32'  alt='Next Page' width='32' /></a></td>
105<td align="center" width="100%">The httplib2 Library</td>
106<td class='online-navigation'><a rel="contents" title="Table of Contents"
107  href="contents.html"><img src='contents.png'
108  border='0' height='32'  alt='Contents' width='32' /></a></td>
109<td class='online-navigation'><img src='blank.png'
110  border='0' height='32'  alt='' width='32' /></td>
111<td class='online-navigation'><img src='blank.png'
112  border='0' height='32'  alt='' width='32' /></td>
113</tr></table>
114<div class='online-navigation'>
115<b class="navlabel">Previous:</b>
116<a class="sectref" rel="prev" href="http-objects.html">1.1.1 Http Objects</a>
117<b class="navlabel">Up:</b>
118<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
119<b class="navlabel">Next:</b>
120<a class="sectref" rel="next" href="response-objects.html">1.1.3 Response Objects</a>
121</div>
122</div>
123<hr />
124<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
125</div>
126<!--End of Navigation Panel-->
127
128</body>
129</html>
130