[opencms-dev] Setting Browser Cache directives

Alexander Kandzior alex at opencms.org
Mon Mar 28 16:45:03 CEST 2005


The is because of the browser cache, many browsers don't even ask the server
again (at last for a day or so) once the have the page in the cache. 

The wayout of this is having an "expires" header set on the page.

You could try to put a "timeout" cache directive (property) to your
templates or one of the incuded elements. OpenCms should then send and
"expired" header set to the next expiration of the timeout, which should
solve the issue. 

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com

 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Marcus Redeker
> Sent: Sunday, March 27, 2005 9:50 PM
> To: 'The OpenCms mailing list'
> Subject: [opencms-dev] Setting Browser Cache directives
> 
> All,
> 
> what is the policy of OpenCMS and settings for brwoser cache? 
> I am having trouble to get the pages displayed correctly 
> because my browser is caching dynamic pages. OpenCMS should 
> set the pragma and cache header on the response so that the 
> browser (and maybe proxy) knows that they are not allowd to 
> cache the page.
> 
> I implemented some kind of login funtionality and after a 
> login the username should be displayed and not the login form 
> anymore. But although the user logged in successfully the 
> login form is still displayed.
> 
> I am using the code below in my template to decide whether to 
> display the username or the login form.
> 
> Thanks,
> 
> --Marcus
> 
> ======== Snippet ======================
> 
> <%	
>   // Create a JSP action element
>   CmsJspActionElement cms = new 
> CmsJspActionElement(pageContext, request, response);
>   String currentUser = cms.user("name"); %>
> 
> <%
>   if ( !currentUser.equals("Guest") )
>   {
> %>
>           <!-- start logged in box -->
>             <table cellspacing="0" class="login">
>               <tr>
>                 <td style="width:180px;"> </td>
>               </tr>
>               <tr>
>                 <td><b class="involvaRed">Eingeloggt als 
> <%=currentUser%></b></td>
>               </tr>
>               <tr>
>                 <td class="logoutLink"><a 
> href="?logout=yes">Logout</a> <a href="?logout=yes"><img 
> src="<cms:link>../resources/images/logout.gif</cms:link>" width="16"
> height="16" alt=""></a></td>
>               </tr>
>             </table>
>           <!-- end logged in box -->
> <%
>   }
>   else
>   {
> %>
>           <!-- start log in box -->
>             <form action='<%=cms.link("/login.jsp")%>' method="post">
>             <table cellspacing="0" class="loginForm">
>               <tr>
>                 <td style="width:180px;"> </td>
>                 <td>
>                   <input class="login" type="text" name="username"
> value="Benutzer" onfocus="this.value='';"><br>
>                   <input class="login" type="password" name="password"
> value="passwd" onfocus="this.value=''";>
>                 </td>
>                 <td style="padding-top:22px;"><input type="image"
> src="<cms:link>../resources/images/go_button.gif")</cms:link>"
>  width="18"
> height="18" alt=""></td>
>               </tr>
>             </table>
>             </form>
>           <!-- end log in box -->
> <%
>   }
> %>
> 
> ============================
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list To 
> change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list