Title: wordpresseritis's Replies | WordPress.org

---

# wordpresseritis

  [  ](https://wordpress.org/support/users/wordpresseritis/)

 *   [Profile](https://wordpress.org/support/users/wordpresseritis/)
 *   [Topics Started](https://wordpress.org/support/users/wordpresseritis/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wordpresseritis/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wordpresseritis/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wordpresseritis/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wordpresseritis/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wordpresseritis/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Front End Users] Caching – restricted content is visible after logging out by using back-button](https://wordpress.org/support/topic/caching-restricted-content-is-visible-after-logging-out-by-using-back-button/)
 *  [wordpresseritis](https://wordpress.org/support/users/wordpresseritis/)
 * (@wordpresseritis)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/caching-restricted-content-is-visible-after-logging-out-by-using-back-button/#post-9047804)
 * First, I tried a server-side solution. At header.php of my theme I added at top
   the following code (where ‘myPageTitle’ corresponds to the page which shall not
   be cached)
 *     ```
       if($_SERVER['REQUEST_URI'] =="/myPageTitle/")
       {
       header("Pragma: no-cache"); 
       header("Cache-Control: no-cache, no-store, max-age=0, must-revalidate");
       header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
       header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
       header("Connection: close");
       }
       ```
   
 * Interestingly, this works well, but not with Safari browser. Does anyone know
   why?
 * For Safari the following JavaScript trick works for me:
 *     ```
       if (window.location == "http://www.myDomain.com/myPageTitle/" || window.location == "http://www.myDomain.com/myPageTitle/#") {
   
           window.onpageshow = function(event) {
           if (event.persisted) {
               window.location.reload();
           }
       };
       }
       ```
   

Viewing 1 replies (of 1 total)