When updating the Nagios web interface with the F5 key or by pressing the ʻRefresh’ button in the browser, the Nagios web page jumps back to the main page.
This behaviour first appeared with Nagios version 3.2.0. Previously, when updating the page – e.g., by pressing F5 – the currently active page was reloaded, and the user could continue working as usual on the updated page.
In Nagios version 3.2.0 the former
index.html, which represents the frameset of the Nagios web interface, was renamed to
index.php. As a result, the web server and browser no longer know whether this page may be kept in the cache or not.
Add the following line to the beginning of the
<?php header("Cache-Control: max-age=7200, public"); ?>
index.php file is usually located in the file path
The first lines of the file should look like this after editing:
<?php header("Cache-Control: max-age=7200, public"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> <title>Nagios</title> <link rel="shortcut icon" href="images/favicon.ico" type="image/ico"> </head> <frameset cols="180,*"> <frame src="side.php" name="side" frameborder="0"> <frame src="main.php" name="main" frameborder="0"> <noframes>
… and so on.
Attention: Following the change, the browser should be restarted, because e.g., Firefox uses temporarily stored information at this point.
As the components involved (browser, web server and possibly even proxy) in the case of PHP files do not know whether the request may be cached, this page is always requested and created completely new by the web server.
This causes the page to be reloaded by the browser. The current page in the frameset cannot be taken over. Therefore the default page of the frameset is loaded.
Within individual PHP pages the caching behaviour of the web server and the browser can be influenced by PHP functions. The caching behaviour is influenced by the HTTP
Cache-Control header. This header can be set with the PHP function
HTTP headers must be set before the first output of the page, so the code must be inserted directly into the first line of the