我正在使用mod安全性来查找post参数中的特定值,并在重复进来时阻止请求。我正在使用mod安全用户集合来完成此操作。问题是我的请求长时间运行,因此一个请求可能需要超过5分钟。我假设的用户集合在第一个请求得到处理之前不会写入磁盘。如果在执行第一个请求期间另一个请求使用post参数的重复值,则第二个请求不会被阻止,因为集合尚不可用。我需要避免这种情况。我可以使用mod安全性中的请求使用基于内存的共享集合吗?任何其他方式?下面的代码片段:使用mod安全阻止重复http请求
SecRule ARGS_NAMES "uploadfilename" "id:400000,phase:2,nolog,setuid:%{ARGS.uploadfilename},initcol:USER=%{ARGS.uploadfilename},setvar:USER.duplicaterequests=+1,expirevar:USER.duplicaterequests=3600"
SecRule USER:duplicaterequests "@gt 1" "id:400001,phase:2,deny,status:409,msg:'Duplicate Request!'"
ErrorDocument 409 "<h1>Duplicate request!</h1><p>Looks like this is a duplicate request, if this is not on purpose, your original request is most likely still being processed. If this is on purpose, you'll need to go back, refresh the page, and re-submit the data."