0

Let's say I have a manager page and it loads a bunch of information from the MySQL database.

The page shows a bunch of requests from other users, and the manager goes through them and marks them off one by one. As this happens, the content is marked in the database as complete and then goes away. $(theElement.fadeOut(500))

Information Request
From Bob
Hey, can I get the special report from last Tuesday? Thanks
[reply] [mark complete]

Information Request
From John
The report for Customer #5182 is incomplete. All I have is this: 
http://alinktothefile.com/foo Can you send it over? Thanks
[reply] [mark complete]

Information Request
From Mark
Did you want the website to look like this? http://somewebsite123.com 
or something else in mind? 
[reply] [mark complete]

On some of these requests, the information might have a link, which the user will click. Once the user clicks the back button in their browser, however, the content that is shown is how the page looked when they originally loaded the page.

So they start at the top of the page with all the stuff they already completed, instead of the information that is actually correct.

Obviously, the links could open in a new tab, however, this is not a great solution, especially on a mobile device.

What are the possible solutions for working around this, so that the dynamic content is always up to date, even when the user presses the back button?

space_food_
  • 800
  • 1
  • 7
  • 23

1 Answers1

0

you can use html meta tags to stop back forward cacheing.

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />

or you can do it in server side code

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

refer this

Using <meta> tags to turn off caching in all browsers?

http://cristian.sulea.net/blog.php?p=2014-01-14-disable-browser-caching-with-meta-html-tags

Sanka
  • 1,294
  • 1
  • 11
  • 20
  • Wouldn't this also mean that none of the images, css files, etc. would be cached? – space_food_ Jan 28 '18 at 03:45
  • I don't know your server side programe. if you use java ,you can define that separately. in spring it's like bellow. refer this. http://www.baeldung.com/cachable-static-assets-with-spring-mvc – Sanka Jan 28 '18 at 03:54