Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何避免范围查询中的重复数据缓存?_Sql_Caching_Memcached - Fatal编程技术网

Sql 如何避免范围查询中的重复数据缓存?

Sql 如何避免范围查询中的重复数据缓存?,sql,caching,memcached,Sql,Caching,Memcached,各位 我们的RESTAPI支持这样的范围资源查询:/API/v1/examples?offset=0&limit=100 我们在memcached上缓存每个查询以提高性能。但是,两个查询可能具有重复的数据范围 例如: /api/v1/examples?偏移量=0,极限值=100 /api/v1/examples?offset=1&limit=101 2~100范围内的数据将缓存两次 有什么方法可以避免这种情况吗

各位
我们的RESTAPI支持这样的范围资源查询:
/API/v1/examples?offset=0&limit=100

我们在memcached上缓存每个查询以提高性能。但是,两个查询可能具有重复的数据范围

例如:
/api/v1/examples?偏移量=0,极限值=100

/api/v1/examples?offset=1&limit=101

2~100范围内的数据将缓存两次
有什么方法可以避免这种情况吗