From cba444fcd69d506df23c3fe2ad0fbaf111cd43bd Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Tue, 26 May 2015 19:40:11 +0100 Subject: [PATCH 1/2] now favs/login is via AJAX, only "Vary" on cookie in account --- lib/MetaCPAN/Web/Controller/Account.pm | 8 ++++++++ lib/MetaCPAN/Web/Controller/Root.pm | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/MetaCPAN/Web/Controller/Account.pm b/lib/MetaCPAN/Web/Controller/Account.pm index 6398a25f026..2e733460478 100644 --- a/lib/MetaCPAN/Web/Controller/Account.pm +++ b/lib/MetaCPAN/Web/Controller/Account.pm @@ -9,6 +9,14 @@ BEGIN { extends 'MetaCPAN::Web::Controller' } sub auto : Private { my ( $self, $c ) = @_; + + # Don't let CDN cache this user specific content + $c->cdn_never_cache(1); + + # Keep everything here as specific to the user + # this is for proxies + $c->res->header( Vary => 'Cookie' ); + unless ( $c->user_exists ) { $c->forward('/forbidden'); } diff --git a/lib/MetaCPAN/Web/Controller/Root.pm b/lib/MetaCPAN/Web/Controller/Root.pm index 88136247e93..efd9620cf4c 100644 --- a/lib/MetaCPAN/Web/Controller/Root.pm +++ b/lib/MetaCPAN/Web/Controller/Root.pm @@ -103,8 +103,6 @@ sub end : ActionClass('RenderView') { $c->stash->{site_alert_message} = $c->config->{site_alert_message}; - $c->res->header( Vary => 'Cookie' ); - $c->fastly_magic(); } From d05180560371ae479eaf14f477412a0befdbe71c Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Tue, 26 May 2015 22:35:30 +0100 Subject: [PATCH 2/2] Update Account.pm --- lib/MetaCPAN/Web/Controller/Account.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/MetaCPAN/Web/Controller/Account.pm b/lib/MetaCPAN/Web/Controller/Account.pm index 2e733460478..0117a85cff7 100644 --- a/lib/MetaCPAN/Web/Controller/Account.pm +++ b/lib/MetaCPAN/Web/Controller/Account.pm @@ -10,9 +10,6 @@ BEGIN { extends 'MetaCPAN::Web::Controller' } sub auto : Private { my ( $self, $c ) = @_; - # Don't let CDN cache this user specific content - $c->cdn_never_cache(1); - # Keep everything here as specific to the user # this is for proxies $c->res->header( Vary => 'Cookie' );