Comments (4)
Thx for the link.
from connect-memcached.
Was #touch
implemented?
from connect-memcached.
from connect-memcached.
By definition "touch" should update the TTL without rewriting the session data. This implementation is broken, as it just exposes "touch" as a synonym for "set". This alias approach has an unwanted side effect that it causes session data to be saved on every route, even when the session was unmodified; this particularly troublesome for web apps that have routes purposely built to not modify the session so they can run in parallel.
It would be better to not expose "touch" at all so express-session's built in modification logic will work correctly.
i'm a memcached noob, but digging deeper I noticed that memcached server does implement touch, but it doesn't do so until 1.4.8. In my anecdotal experience this is too new for many deployments, so fixing "touch" correctly would break this module for many users.
So that leaves a few options for a fix:
- remove the bogus "touch" as "set" alias and update the docs to state touch isn't supported.
- add a flag options.serverSupportsTouch and switch our touch implementation between "touch" or the old "set" behavior dynamically. This is my favorite as it guarantees not breaking anybody that depends on the existing build.
- similar to above but rely on client.version callback to switch implementations. I'm very not fond of this approach because it seems version detection is brittle for customer memcached builds.
Happy to make a PR for your favorite of the above. Thanks.
from connect-memcached.
Related Issues (18)
- session expire HOT 1
- License missing HOT 1
- Example won't work HOT 8
- Dependency on "connect" HOT 1
- Does your library support SASL? HOT 3
- maintenance help HOT 1
- Confirm memcached connection HOT 6
- user logout automatically HOT 2
- No authentication? HOT 2
- how to set prefix HOT 3
- Possible bug in AWS environment HOT 10
- [Node v8.9.4] Warning: Use Cipheriv for counter mode of aes-256-ctr HOT 9
- Passing in a existing memcached client ignores the secret option HOT 5
- Store fails on memcached 0.0.8 HOT 2
- Latest test suite HOT 4
- Crypto algorithm HOT 6
- Session cookies issue when upgrading from v1 to v2 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-memcached.