snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
721 stars 52 forks source link

fix eventual consistency on redirect after adding/disabling account #115

Closed snarfed closed 10 years ago

snarfed commented 10 years ago

right now, when you add or disable an account and get redirected to your user page, it doesn't show the updated data. e.g. if you added a feature, it still shows the signup buttons for that feature. refreshing fixes it.

i store the Source entity with a straight put in Source.create_new, and get it back with another straight get in UserHandler, so datastore consistency shouldn't be the problem. maybe the user page itself is getting cached?

kylewm commented 10 years ago

maybe the user page itself is getting cached?

I think it's this.

My reading of the "Network" tab is that it receives the 302 Redirect from /twitter/add, but doesn't even request the user page. Would it work to redirect to /twitter/kyle_wm?[timestamp]?

bridgy-cached-user-page

snarfed commented 10 years ago

huh, i think you're right. nice sleuthing!

looking at the output from curl -i https://www.brid.gy/twitter/schnarfed, we do send Cache-Control: max-age=300 in the response.

..aha, we do actually set that ourselves, buried deep in webutil. whee.