4 ms·
You can easily get to 1mb if you follow the cache everything mantra that reddit is using here.
by disordinary 14y ago
You can easily get to 1mb if you follow the cache everything mantra that reddit is using here.
- nostrademons 14y agoWhy in sessions, though? Why not cache everything as uniquely-identified resources and store only the resource ID in the session? That way, resources can be shared across different sessions. I'm trying to think of a case where a user's actions (that's what's supposed to be in sessions, right?) can result in 1M of data and drawing a blank. Maybe if they're uploading images or video transiently, like in Google's Search-by-Image feature, but even that seems like a case where you should upload the image permanently and just store a reference to it in the session. Edit: Answered my own question: oftentimes it's useful to store a history of the user's recent actions in their session, because then you can build a more responsive, more tailored UI. You can save transient data they've already entered, avoid showing them promos they've already indicated no interest in, and potentially use it to predict useful things to show them next. Even then, though, it'd take 500 pageviews at 2K apiece (which is a very generous estimate) to hit a meg of data.
- Morg 14y agoNO ffs NO. There is absolutely no reason to store anything but the session ID in a session cookie. You can keep it in the js, so why use session ? multiple pages ? dude you're living in the past.