Redis under Classic ASP(VBScript)

2019-07-15 08:55发布

问题:

I'm developing a website under Classic ASP(espeically VBScript). To enhance site performance, I'm considering to use Redis(key-value database). From http://redis.io/clients, there is no client with VBScript. As a research, I have to develop a service/COM to fit into my requirement.

Does anybody has such experience? or maybe you can share some code/tip. Thanks a lot.

回答1:

I have researched the same for memcached/couchbase.

You have a few options: you can look for a javascript (node.js?) implementation. Classic ASP can also be written in javascript instead of VBscript. It might be possible to port the code to classic ASP.

I would advise you to use a WSC to encapsulate the code. A WSC is like a COM component, except written in vbscript or jscript. You can use it exactly like a COM object, but you can dynamically change the code without re-registering it every time. Here is some more info:

http://aspalliance.com/414_Windows_Scripting_Components_WSC_in_ASP http://precompiled.wordpress.com/2007/11/26/hmac-sha1-encryptie-onder-classic-asp/
(note that the links to the WSC's no longer work, but there are mirrors in the comments)

The second path you can take is to find a .NET client and wrap it with a COM wrapper. If you have the source code and Visual Studio it should be possible to expose the .NET component as COM. Some more info on that is here:

http://msdn.microsoft.com/en-us/library/ms404285.aspx

Good luck!
Erik