1.首先在sqlmapconfig.xml中加入
<settings
cachemodelsenabled="true"
enhancementenabled="true"
/>
2.在sql.xml中加入
<cachemodel id="hotwordcache" readonly="true" type="lru" serialize="true">
<!--when the data has changed we flush the cache-->
<flushinterval seconds="60"/> ---如果想要在60秒后刷新缓存,必须把type设 为"lru"
<flushonexecute statement="inserthotword"/>----当进行增,删,改的时候刷新缓存
<flushonexecute statement="hotworddel"/>
<property name="size" value="1000" />
<property name="reference-type" value="weak" />
</cachemodel>
3.我开始type配的属性为"memory",每次数据库的操作都是直接反应出来,没有经过缓存,后来把type改为"lru"才能实现从缓存中取数据,60秒之后刷新缓存的目的.
<settings
cachemodelsenabled="true"
enhancementenabled="true"
/>
2.在sql.xml中加入
<cachemodel id="hotwordcache" readonly="true" type="lru" serialize="true">
<!--when the data has changed we flush the cache-->
<flushinterval seconds="60"/> ---如果想要在60秒后刷新缓存,必须把type设 为"lru"
<flushonexecute statement="inserthotword"/>----当进行增,删,改的时候刷新缓存
<flushonexecute statement="hotworddel"/>
<property name="size" value="1000" />
<property name="reference-type" value="weak" />
</cachemodel>
3.我开始type配的属性为"memory",每次数据库的操作都是直接反应出来,没有经过缓存,后来把type改为"lru"才能实现从缓存中取数据,60秒之后刷新缓存的目的.
本文介绍了如何在SQLMap中配置缓存模型以提高查询效率。通过设置<settingscachemodelsenabled=true>启用缓存,并详细说明了如何在sql.xml文件中配置基于LRU算法的热词缓存,包括缓存刷新间隔和触发条件。
2180

被折叠的 条评论
为什么被折叠?



