简体   繁体   中英

How to prevent back button from refreshing the previous page on HTTPS?

I have an application in which a module lists out some tour packages from various third party vendors through SOAP calls. This takes about 90 seconds to load.

Once one of the package is clicked, another webservice is called to get the details of the package.

Now once you click browser back from here, it is supposed to show the list without calling the webservices again (from cache). It happens so in dev machine which is http. But on production server the back button refreshes the list page and I have to wait again for about 90 seconds which is pretty painful.

Is it because of HTTPS? How do i force navigate back without refreshing the previous page?

The application in written in PHP, The production server is redhat while the dev is windows (if it helps).

It has nothing to do with HTTPS. Cache is only controlled by the Expires/Cache-Control HTTP headers, which work the same regardless of whether the connection is encrypted or not. Most likely your production server is enforcing different cache headers than your development box.

Having said that, you should also employ server-side caching for such an expensive operation. Perhaps have the data be refreshed periodically by a cron-job or such and save them on the server for fast retrieval. Any page that requires 90 seconds of work to be displayed needs to be rethought.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM