Skip to content

Commit

Permalink
configure some entity caches ...
Browse files Browse the repository at this point in the history
  • Loading branch information
svencc committed Apr 15, 2024
1 parent 1cf570c commit 7d3a14f
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
4 changes: 4 additions & 0 deletions services/recom-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
<artifactId>hibernate-jcache</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down
61 changes: 58 additions & 3 deletions services/recom-backend/src/main/resources/ehcache-hibernate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<cache-template name="entityCache">
<!-- <expiry><none/></expiry>-->
<expiry>
<ttl unit="hours">876000</ttl>
<!-- <ttl unit="hours">876000</ttl>-->
<ttl unit="minutes">5</ttl>
</expiry>
<listeners>
<listener>
Expand All @@ -43,9 +44,9 @@
</listener>
</listeners>
<resources>
<heap unit="entries">1000</heap>
<heap unit="entries">200</heap>
<!-- <offheap unit="MB">10</offheap> -->
<disk persistent="true" unit="MB">1000</disk>
<!-- <disk persistent="true" unit="MB">1000</disk> -->
</resources>
</cache-template>
<!-- CACHE TEMPLATES -->
Expand All @@ -56,24 +57,78 @@

<!-- ENTITIES -->
<cache alias="com.recom.entity.Account" uses-template="entityCache">
<expiry>
<ttl unit="minutes">60</ttl>
</expiry>
<resources>
<heap>1000</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.MapDimensions" uses-template="entityCache">
<expiry>
<ttl unit="minutes">60</ttl>
</expiry>
<resources>
<heap>1</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.structure.ClassNameEntity" uses-template="entityCache">
<expiry>
<ttl unit="minutes">60</ttl>
</expiry>
<resources>
<heap>500</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.structure.MapDescriptorTypeEntity" uses-template="entityCache">
<expiry>
<ttl unit="minutes">60</ttl>
</expiry>
<resources>
<heap>500</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.GameMap" uses-template="entityCache">
<expiry>
<ttl unit="minutes">10</ttl>
</expiry>
<resources>
<heap>1</heap>
</resources>
</cache>
<cache alias="com.recom.entity.Configuration" uses-template="entityCache">
<expiry>
<ttl unit="minutes">60</ttl>
</expiry>
<resources>
<heap>200</heap>
</resources>
</cache>
<cache alias="com.recom.entity.Message" uses-template="entityCache">
<expiry>
<ttl unit="minutes">30</ttl>
</expiry>
<resources>
<heap>100</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.SquareKilometerStructureChunk" uses-template="entityCache">
<resources>
<heap>100</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.structure.MapStructureEntity" uses-template="entityCache">
<resources>
<heap>10000</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.SquareKilometerTopographyChunk" uses-template="entityCache">
<expiry>
<ttl unit="minutes">5</ttl>
</expiry>
<resources>
<heap>500</heap>
</resources>
</cache>
<cache alias="com.recom.entity.map.structure.ResourceNameEntity" uses-template="entityCache">
</cache>
Expand Down

0 comments on commit 7d3a14f

Please sign in to comment.