I'm using Drupal 6 with the WebForms module, and my entire site uses https.

I need to insert some cache-control statements in the page headers of only certain pages (ones with forms on them). Is this something I can do by modifying my theme? Any clues about how to do it?

If you're curious, the problem I want to solve occurs when an anonymous user A fills out a form on the site and submits it and gets to the confirmation page and then walks away without closing the browser. User B then walks up to the computer, hits the "back" command on the browser, and sees everything User A filled out on the form. This user-typed data is not being re-sent by the server, it is just remembered by the local web browser app. I believe if I send some cache-control statements in the header I can prevent that behavior.

Thanks! -Steve

  • 1
    It's all about cache-control headers, see the accepted answer to stackoverflow.com/questions/2510151/… for a working example (and make sure to note the comment about Google Chrome). If you need advice getting that to work with Drupal, editing your question here would probably be the best thing to do – Clive Dec 12 '12 at 15:22
  • Dear Clive, Thanks for the link, and if I were doing static html pages I think that would be enough to get me started. But since Drupal is building these pages for me I'm looking for a way to have Drupal insert these headers for me, and only on certain pages. Are you saying it would be better to phrase the question as "how do I get Drupal to insert extra information in the headers but only for pages that have forms on them"? Any suggestions appreciated. – Steve Rothman Dec 12 '12 at 16:12
  • Exactly :) If you lead with "I need to insert headers 'foo' and 'bar' on specific pages for 'baz' reason, making sure there are no duplicates" I'm sure you'll get a good response – Clive Dec 12 '12 at 16:14

Your Answer

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

Browse other questions tagged or ask your own question.