Skip to content

Only store new session data if the data is non-default #161

Open
wants to merge 1 commit into from

1 participant

@shish
shish commented Jun 28, 2012

Forcing every person (and web crawler) who visits the site to have a unique cookie means that every page is unique, and thus un-cacheable. Also, Googlebot crawling my site results in millions of sessions clogging the database, that all contain default data.

I've made a small change to web/session.py:Session._save so that it only stores sessions and sets cookies if the data is different from the initializer - with that done, I can now stick Varnish in front of the site, and it correctly serves cached pages to anonymous browsers and dynamic pages to logged-in users, drastically reducing the load.

(This is a pull-request version of #158, as requested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.