forked from aolserver/nsmemcache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
executable file
·73 lines (50 loc) · 2.13 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Configuration
nsd.tcl
ns_section ns/servers/server/modules
ns_param nsmemcache nsmemcache.so
ns_section ns/server/module/nsmemcache
ns_param server localhost
## If you have more then one server then define it in a new line
ns_param server cache
Usage
ns_memcache get key dataVar ?lengthVar? ?flagsVar?
## This command set the value in a unique key and if key already exists then the old value
## replaced with the new one
ns_memcache set key value ?expires? ?flags?
## This command add the value one time and if you
## add again with the same key in your script then it will not be overriden
## If you want to override the value of the same key then use replace one
ns_memcache add key value ?expires? ?flags?
ns_memcache replace key value ?expires? ?flags?
ns_memcache delete key ?expires?
ns_memcache incr key value ?varname?
ns_memcache decr key value ?varname?
ns_memcache version ?ip?
Authors
Vlad Seryakov [email protected]
Ported For AOLServer By:
Majid Khan [email protected]
Example:
1)
set check [ns_memcache version "192.168.5.8"]
print $check
2)
# store the value for 1 min i.e. 60secs
ns_memcache set firstkey firstvalue 60
3)
# Will delete firstkey and then you can define another or add another key instantly
ns_memcache delete firstkey
# But if you delete the firstkey with epxiry then the delted key will be never be added
# untill the expiry time becomes over.
# firstkey can only be set after 1 min not before then that
ns_memcache delete firstkey 60
4)
# The below will increment the value 3 to what our the value of the key is in the memory
ns_memcache incr firstkey 3
5) This one is incomplete one... :(
# The below will increment the value 3 to what our the value of the key is in the memory
ns_memcache decr firstkey
6)
# Replace the key value with the new one
# but the value should be set in the memmory first see above the seond example
ns_memcache replace key value