0

The Context

The homepage of the java application I am working on displays a panel of button. Each one for a specific unit of the application.

Those buttons are disabled serverside wether or not its unit is (boolean stored in database).

The JSP page creates a bean and calls a static method from the service to retrive the booleans and to disable or not the buttons :

<jsp:useBean id="modules" class="appli.dto.ModulesDto" scope="session" />
${ AppliService:getModulesDto(sessionScope.modules) }

One of these units disables/enables the others (sets boolean values in database)

The JSP generates and send the HTML homepage on request (calling/refreshing page), all is working fine there.


The Problem

In the unit toggling the others, to validate the changes triggers a synchronious saving new values call, displays an alert() then redirects to the homepage.

Expactations :
After redirection, the homepage toggles the buttons, according to the updated database.

Then the behaviour depends of the webbrowser.
NB : IE and FireFox versions are demanded. The issue cannot be resolved by updating them

IE 11 : On redirection, every units, except for the administrative one
FF ESR 38.5.1 : Displays the previous page :

  • On first change : displays the starting homepage

  • On successive changes : displays the page which should have been displayed after th previous change (as if FF always lags a step )

Google Chrome 53.0.2785.116 : Displays the expected content

On refresh, each browser displays the expected content.

Question :
The browsers clearly behave specifically each other. Why do they do and how prevent the unexpected behaviour of IE and FF?


What i have tried

Adding "no cache" meta tags. I added the following tags as recommanded here

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

But i did not notice any change.

Community
  • 1
  • 1
Charly
  • 282
  • 1
  • 12
  • Possible duplicate of [Making sure a web page is not cached, across all browsers](http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers) – Sanka Sep 21 '16 at 15:01

2 Answers2

0

As a workaround, Try changing Internet options setting on IE. General=>Setting=>Temporary Internet Files Select, Every time I visit the webpage radio button. Click OK to close the Settings dialog. Click OK to close the Internet Options dialog.

0

Try this first in controller ( servlet or portlet) level

it is removing bfcache when browser back and forward by adding cache control to response

response.setProperty("cache-control", "max-age=0,no-cache, no-store, must-revalidate"); 
response.setProperty("Pragma", "no-cache"); // HTTP 1.0
response.setProperty("Expires", "0"); // Proxies.

or html tags

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

reference:

How to control web page caching, across all browsers?

Community
  • 1
  • 1
Sanka
  • 1,104
  • 1
  • 10
  • 18