Jump to content

Recommended Posts

Forgive me if I'm in the wrong area, but not sure what forum this was most appropriate for.

 

This community has always been the most helpful for me so I'm hoping I can find an answer.

 

We have a form that uses multiple selects as filters for our products. Upon submission it retrieves matching products and displays a list. This all works great until you hit the "Back" button on IE 7/8/9 the page drops and displays the message "The Webpage Has Expired" which forces the user to have to refresh the page and click retry to get the page to reload. This is horrible behavior and a pain the butt for the user.

 

We did find a work around which is declaring the page header private like this

header( 'Cache-Control: private, max-age=10800, pre-check=10800' );

Which has served us well over the last year, however now we want to move the search functionality to our homepage in which we can't use a private header, its an online shop and the homepage (index.php) is the base url for so many sub pages.

 

Is there any other way anybody knows to stop IE from throwing the webpage expired message?

 

In my perfect world IE would stop being supported, and Microsoft would concede the browser market to FF / Safari / Chrome.. until then.. I must deal with this.. Your help is as always, very valued, and very much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/256134-ie-back-button-and-form-submittions/
Share on other sites

Well I managed to find a solution for this.

 

In case anybody else runs into this problem..

 

By adding:

BrowserMatch MSIE force-no-vary  

to your .htaccess file you can prevent IE from caching http pages thus resulting in no webpage expired messages when you hit the back button. It isn't suppose to work on https pages which is actually good news as this is where you want the page to be cached to prevent duplicate submissions of orders and such. Either make sure you test it on your server before running with it.

 

Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.