6

I am using SDL Web 8.1 and DXA 1.5 for my website development. I am facing an issue on the website. While traversing the website, if I click on the back button on the browser toolbar, the previous page's JSON Model is displayed in the browser. It is happening only on some pages, not all. However, if I disable the browser cache, it works fine.

I am also not able to debug it, as the request doesn't goes back to code. Can anyone please help? Has anyone faced a similar scenario before?browser developer control panel showing "Disable cache" enabled

It happens only on the product pages of our website, which are rendered as CMS Pages.

3
  • Looks like its caching issue, try to add "Vary: Accept" to the response header and try.
    – Raj Kumar
    Aug 23, 2017 at 7:08
  • Can you edit your question and explain a few things in more detail? What exactly do you mean with rendered as CMS Pages? What browser are you using and could it be that it requests with an Accept: application/json header on the back button (see also stackoverflow.com/questions/16400639/…)? Aug 23, 2017 at 7:17
  • Hi Bart, it is happening on all browsers. Also, we were not appending any response header explicitly, so not sure why this happened for certain pages. However, after pushing "Vary: Accept" to response header, all seem to work fine. Aug 23, 2017 at 7:38

1 Answer 1

7

This is browser specific Cache issue, Add "Vary: Accept" to the response header and try to replicate your issue. I had resolved similar issue with above setting.

1
  • Thanks Raj, this seems to resolve the issue on my local environment. I will test it on server as well. Aug 23, 2017 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.