Reputation: 5091
when using django middleware, for every new visitor, a new session record or session file is created. this is fine except for websites where a large traffic part do not need session (exemple : a blog that is seen by many but written by only one).Is it possible to have the session middleware activated only for some urls so many I/Os will be saved ?
Upvotes: 0
Views: 689
Reputation: 6511
This is actually not true. Sessions are lazily created, so only if data is put in the session a new record is created. Have a look here:
https://github.com/django/django/blob/master/django/contrib/sessions/middleware.py#L27
Upvotes: 1