8

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.

9

First step is to see if http://drupal.org/project/cacheexclude does it for you. If your on Drupal 6 check out this issue: http://drupal.org/node/197786#comment-1817644. If your on Drupal 7 see this one: http://groups.drupal.org/node/212103

If none of the above do it for you, you might want to look at modifying your VCL and add in more logic to make it work with your site.

Also take a look at something like http://drupal.org/project/globalredirect in order to make sure you have one URL for a resource (like the front page).

  • you are da man, once I checked the "Frontpage Redirect Handler" box in global redirect the problem was fixed. Thanks!!! – uwe Apr 17 '12 at 1:46
12

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')->trigger();

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.