[Opensymphony-oscache] Cache works but doesn't recognize changes in underlying data
John <[email protected]> Mon, 29 Aug 2005 10:16:13 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <33151811.1125328647324.JavaMail.os-j2ee@opensymphony01.contegix.com> |
I'm working with oscache and tiles and what I would like to have happen is if the tile data has not changed then load using the cached version.
If the tile data has changed then refresh the cached version.
As it stands, I get the cached version all the time.
Here is the code for the tile.
... imports and such...
<tiles:importAttribute />
<%
Logger logger = Logger.getLogger("jsp.tiles.summary_Tile.jsp");
PropertyConfigurator.configure(pageContext.getServletContext().getRealPath("/WEB-INF/app.log4j.properties"));
int summary_hash_out = pageContext.findAttribute("summary_out").toString().hashCode();
String cacheID = "summary_Tile-" + summary_hash_out;
logger.debug("summary_Tile-" + summary_hash_out);
logger.info("fd_keywords_Tile Start");
%>
<cache:cache key="<%=cacheID%>" time="3600" scope="session">
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28" height="15"> </td>
<td class="fieldlabel" valign="bottom" height="15">Summary<span class="fieldlabel_nonbold"> (Please provide a brief description. This will appear on all folder lists.)</td>
</tr>
<tr>
<td width="28" height="15"> </td>
<td valign="top">
<textarea rows="3" cols="85" name="fd_keywords" onKeyPress="return TextMaxLength(event, this.form.fd_keywords.value, 300);">
<tiles:getAsString name="summary_out" /></textarea>
</td>
</tr>
<tr>
<td colspan="2" height="5" style="font-size:5px"> </td>
</tr>
</table>
</cache:cache>
How does OScache tell if the underlying data has changed and hence to refresh the data?
- John
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6206&messageID=14049#14049