cancel
Showing results for 
Search instead for 
Did you mean: 

Portal cache problem - always getting old CSS file from modified component

Former Member
0 Kudos

Hi all,

I have a very annoying problem:

I modified a portal component (toolarea) to fit into our portal layout and added a css file to it. In the process of development I made several changes to the css file and re-deployed the PAR file.

Now, when opening the portal I always get an old version of the CSS file which causes the layout to fall apart.

The weird thing is:

- Pressing [Ctrl + F5] (explicit reload without cache) loads the correct file.

- Pressing only [F5] (simple reload) then again loads the old file.

To answer the obvious questions in advance:

- The iView is set to not be cached.

- Portal navigation cache is switched off completely.

- Browser cache is disabled and was cleared before reload.

- Proxy is disabled.

I already removed the component from PCD and redeployed it, deleted the corresponding iView and recreated it, but nothing shows any effect to the problem.

Where is that old version of the css file comming from?

And even more important: How do I prevent that from happening?

Thanks in advance and kind regards,

Roland

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

As I found no real solution to the problem, this is what I did as workaround:

- rename the .css file to .jsp

- include java code in the file to set no-cache headers

That way the file should never get cached anywhere.

Not very nice but works and much simpler than renaming the file and the reference to it in the code after every change.

Maybe the code is useful for someone else (although it's nothing special), so I post it here:


<%@ page import = "java.util.Date" %>
<%@ page import = "javax.servlet.http.*" %>
<%
Date now = new Date();
response.addHeader("Pragma","no-cache");
response.addHeader("Cache-Control","no-cache");
response.addDateHeader("Date",now.getTime());
response.addDateHeader("Expires",now.getTime());
%>

Kind regards an thanks anyway,

Roland

former_member193769
Active Contributor
0 Kudos

Hi,

Try re-starting the cluster.

Check is there any css mapping in visual administration.

Thanks and Regards,

gopal.sattiraju

Former Member
0 Kudos

Hi,

restarting the cluster is no real option here. And as I suspect this to be a general problem (we already had that in the past on another portal, even after a restart), it might happen again after the next changes to the files. I cannot restart the cluster everytime I update a CSS file.

Can you tell me where I have to look for a css mapping in visual administrator? I don't know where I find that setting.

Many thanks,

Roland

Former Member
0 Kudos

Hi,

To resolve cache problem due to static files .css and .js, just rename the existing file. Also change file name in code. Deploy and Run (No need to restart).

Regards

Baby