From 64cdbe6c5578df1dc49d8e3dd72451ab0ac96bd2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 20 Sep 2010 13:42:58 -0700 Subject: Ticket #2750: fixes to HTTP caching behavior across login/logout boundaries * now ignoring if-modified-since if we failed an etag if-none-match comparison, per spec * now including a hash of user id/nickname in most etags, so we'll update the view properly after login/logout For API methods, checking the API-auth'ed user. (Many change results to include things like 'you're subscribed to this user' or 'this is one of your favorites', so user info is again needed) There'll still be some last-modified stamps that aren't including user info properly, probably. --- actions/apidirectmessage.php | 1 + actions/apigrouplist.php | 1 + actions/apigrouplistall.php | 1 + actions/apigroupmembership.php | 1 + actions/apigroupshow.php | 1 + actions/apistatusesshow.php | 1 + actions/apisubscriptions.php | 1 + actions/apitimelinefavorites.php | 1 + actions/apitimelinefriends.php | 1 + actions/apitimelinegroup.php | 1 + actions/apitimelinehome.php | 1 + actions/apitimelinementions.php | 1 + actions/apitimelinepublic.php | 1 + actions/apitimelinetag.php | 1 + actions/apitimelineuser.php | 1 + actions/shownotice.php | 1 + 16 files changed, 16 insertions(+) (limited to 'actions') diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php index 7a0f46274..e7ea38dfa 100644 --- a/actions/apidirectmessage.php +++ b/actions/apidirectmessage.php @@ -357,6 +357,7 @@ class ApiDirectMessageAction extends ApiAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), strtotime($this->messages[0]->created), strtotime($this->messages[$last]->created) diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 148c802f4..319a1e424 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -213,6 +213,7 @@ class ApiGroupListAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->groups[0]->created), diff --git a/actions/apigrouplistall.php b/actions/apigrouplistall.php index a8317608d..cc7cd901d 100644 --- a/actions/apigrouplistall.php +++ b/actions/apigrouplistall.php @@ -204,6 +204,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), strtotime($this->groups[0]->created), strtotime($this->groups[$last]->created)) diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index ffd5c7c7d..b7f3064b5 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -183,6 +183,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->group->id, strtotime($this->profiles[0]->created), diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 2998e505e..9b90e6b38 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -149,6 +149,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->group->id, strtotime($this->group->modified)) diff --git a/actions/apistatusesshow.php b/actions/apistatusesshow.php index 476820a43..84f8079db 100644 --- a/actions/apistatusesshow.php +++ b/actions/apistatusesshow.php @@ -194,6 +194,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->notice->id, strtotime($this->notice->created)) diff --git a/actions/apisubscriptions.php b/actions/apisubscriptions.php index 63d65f289..749d16f06 100644 --- a/actions/apisubscriptions.php +++ b/actions/apisubscriptions.php @@ -181,6 +181,7 @@ class ApiSubscriptionsAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, isset($this->ids_only) ? 'IDs' : 'Profiles', diff --git a/actions/apitimelinefavorites.php b/actions/apitimelinefavorites.php index 7228960c0..f5ce5d2fd 100644 --- a/actions/apitimelinefavorites.php +++ b/actions/apitimelinefavorites.php @@ -259,6 +259,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->notices[0]->created), diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php index 40ce35979..c96391c12 100644 --- a/actions/apitimelinefriends.php +++ b/actions/apitimelinefriends.php @@ -346,6 +346,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->notices[0]->created), diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 7a40fd808..5138a4b5e 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -229,6 +229,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->group->id, strtotime($this->notices[0]->created), diff --git a/actions/apitimelinehome.php b/actions/apitimelinehome.php index 27eb74169..1ceb3d902 100644 --- a/actions/apitimelinehome.php +++ b/actions/apitimelinehome.php @@ -254,6 +254,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->notices[0]->created), diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index ed1ad20e3..354dc58b6 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -244,6 +244,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->notices[0]->created), diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index f90164288..0119b504a 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -311,6 +311,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), strtotime($this->notices[0]->created), strtotime($this->notices[$last]->created)) diff --git a/actions/apitimelinetag.php b/actions/apitimelinetag.php index c7ec172ae..712703694 100644 --- a/actions/apitimelinetag.php +++ b/actions/apitimelinetag.php @@ -232,6 +232,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->tag, strtotime($this->notices[0]->created), diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index 17a283663..0c97aad21 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -234,6 +234,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->notices[0]->created), diff --git a/actions/shownotice.php b/actions/shownotice.php index 9c5d83441..86df5f9f3 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -151,6 +151,7 @@ class ShownoticeAction extends OwnerDesignAction strtotime($this->avatar->modified) : 0; return 'W/"' . implode(':', array($this->arg('action'), + common_user_cache_hash(), common_language(), $this->notice->id, strtotime($this->notice->created), -- cgit v1.2.3-54-g00ecf