Memcached has several important restrictions, especially the expiration time restrictions. Otherwise, it is easy to step on the mines: www.2cto.com 1) size limit of a single cache value: the size limit of a single memcached cache value is 1 MB (1000000 bytes). If this limit is exceeded, the following error occurs: ValueError: values may not be more than 1000000 bytes in length; received 2000000 bytes 2) key length limit: memcache's keys limit is 250 bytes. If this length is exceeded, an error is returned: ValueError: keys may not be more than 250 bytes in length, received 14670 bytes www.2cto.com 3) expire expiration time limit: There are two ways to set the expiration time: 1. The unix timestamp format is used, that is, the time offset (in seconds) from 00:00:00. 2. The time interval (in seconds) from the current time) it cannot be greater than 2592000 (30 days) from the time interval of the current time. If the time value is greater than 2592000, memcached interprets the time as the unix timestamp format, that is, the offset of the number of seconds from 1970.01.01. 0 indicates that it never expires. Pay special attention to this issue. When we set a time interval greater than 2592000, for example, 2592010, the written data will be considered as a unix timestamp format, and the data has expired after it is written, this is equivalent to preventing data from being written. Worse, the memcached server and the client driver will not throw an exception or print any warning information, for memcached, such a time value is also reasonable. P.S. The limit of this expire may seem to be reflected after memcached 1.2.6. This phenomenon was not observed in previous versions such as 1.2.1.