我已经使用GeoServer实现了一个Web应用程序以提供图块地图。为了应用缓存策略,我启用了嵌入式GeoWebCache并在PostgreSQL数据库中设置了平铺页面。将磁盘配额设置为5 MB,并使用LFU方法来测试超出配额限制的截断行为。当缓存量大于5 MB且GeoWebCahe删除所有图块而不考虑每个图块的“ frequency_of_use”时,将显示此问题。这是预期的行为,因为我认为它应该首先删除最少使用的图块。
<!-- geowebcache-diskquota.xml -->
<gwcQuotaConfiguration>
<enabled>true</enabled>
<cacheCleanUpFrequency>10</cacheCleanUpFrequency>
<cacheCleanUpUnits>SECONDS</cacheCleanUpUnits>
<maxConcurrentCleanUps>2</maxConcurrentCleanUps>
<globalExpirationPolicyName>LFU</globalExpirationPolicyName>
<globalQuota>
<value>5</value>
<units>MiB</units>
</globalQuota>
<quotaStore>JDBC</quotaStore>
</gwcQuotaConfiguration>
和geowebcache-diskquota-jdbc.xml文件:
<gwcJdbcConfiguration>
<dialect>PostgreSQL</dialect>
<JNDISource>java:comp/env/jdbc/gwc</JNDISource>
<connectionPool>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/gwc</url>
<username>postgres</username>
<password></password>
<minConnections>1</minConnections>
<maxConnections>10</maxConnections>
<connectionTimeout>10000</connectionTimeout>
<maxOpenPreparedStatements>50</maxOpenPreparedStatements>
</connectionPool>
</gwcJdbcConfiguration>