How to prevent caching of a page? I've set a custom homepage url at example.com/welcome.
The user comes to the example.com/ and logs in on that page. Drupal redirects to
example.com/welcome

Now the user clicks on the home page which loads example.com/ from browser cache (which has the login form on it).

I guess if Drupal would reload the homepage at example.com/ instead of example.com/welcome I wouldn't have that problem. How would I do that?

What else could I be doing?

Btw, anonymous pages are getting cached by varnish.
drupal_page_is_cacheable can also be used.

Calling:

drupal_page_is_cacheable(FALSE);


Should do the trick.

And for Drupal 8:

Drupal::service('page_cache_kill_switch')-&gt;trigger();