express-limiter icon indicating copy to clipboard operation
express-limiter copied to clipboard

So close to working with memcache

Open robwilkerson opened this issue 9 years ago • 1 comments

I have a project where this module would be pretty much perfect, but I'm using Memcache instead of Redis (via https://github.com/3rd-Eden/memcached). As far as I can tell, it should be trivial to adapt since the Memcache module also has get() and set() functions. I'd love to submit a pull request if it's something you have any interest in adding, but...

I'm confused by the db.set() call. Specifically the 3rd parameter: 'PX'. What is that? I haven't used the redis module, but looking at the docs, I don't see where that parameter is necessary or even allowed. I'm sure I'm missing something, but that param keeps the module from working with memcache.

Can you help me understand what's happening there so I know how to proceed (again, assuming memcache compatibility is of interest to you).

Thanks.

robwilkerson avatar Jan 15 '16 21:01 robwilkerson

I'm sure by now you've figured it out :) but in case you haven't, PX is an expiration in milliseconds, see: http://redis.io/commands/SET

maxnachlinger avatar Jul 16 '16 21:07 maxnachlinger