I'm writing a web app, and I'm having a serious problem with too much caching. I use CakePHP 2.0 if that matters at all.
Anyways basically the problem I'm having is the browser caches my app way too often. For example if I have a user fill out a form and then add a flash message and redirect the user to their dashboard the flash message appears just fine, but it appears until I refresh the page. So if I navigate away from that page and navigate back, the flash message is still there. That's just a small irritant, the bigger issues are when pages actually change depending on user action.
For example on the admin side I may update a users status which changes their dashboard in some way. The problem is the updated dashboard will not be seen without a refresh. What a hassle!
My question isn't how to fix this, I know how to stop caching all together. It seems like caching is an important part of a web apps performance though and I don't want to stop caching all together as I can see it slowing things down.
So what is normally done in these situations? Should I just stop the page from caching all together? Seems like an extreme solution. Or should I just link to all of my pages with something like:
http://mywebsite.com/user?t=<?php echo time(); ?>
Or is there something else that I'm missing? Any advice is appreciated!