rensPols / ex-dock

An ecommerce platform build with Vert.x Kotlin and Docker
Apache License 2.0
3 stars 0 forks source link

Template engine caching #48

Open Moltensnor opened 4 days ago

Moltensnor commented 4 days ago

Cache

Added a templating cache to the templateEngineVerticle. The templates get saved as compiled strings and can be fetched on request.

Refresh

The data cache refreshes when data gets added/edited/removed. This only refreshes the data that gets changed. The template cache recompiles entirely when this happens.

Cache data

Removed the flag from the flag data. This is because Caffeine has a built-in cache refresh. Instead of checking if the flag is set before fetching, it instead refreshes on data change.

Optimization

Removed the invalidate from the hit counter and changed it to a refresh. This makes it so the data gets fetched a bit quicker. The test now runs in 5.532 seconds in IntelliJ itself. So with the starting time of the verticles.

Closes #47