I have an issue where users navigate through a page, log in, return to that page, and receive a cached version without logged in content. I need to turn off the caching for those pages. Adding the following to my functions.php file worked but it applies to all pages and makes my site slow. How can I apply this only to those pages, or only for logged in users? Thank you so much for any help on this.
header(“Cache-Control: no-cache, no-store, must-revalidate”); // HTTP 1.1.
header(“Pragma: no-cache”); // HTTP 1.0.
header(“Expires: 0”); // Proxies.