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.

  • Looks like its caching issue, try to add "Vary: Accept" to the response header and try. – Raj Kumar Aug 23 '17 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/…)? – Bart Koopman Aug 23 '17 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. – Sharad Kumar Sangal Aug 23 '17 at 7:38
6

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.

  • Thanks Raj, this seems to resolve the issue on my local environment. I will test it on server as well. – Sharad Kumar Sangal Aug 23 '17 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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