Question: We are using SDL Web 8.5 and DXA CTP 2.0 Java. DXA Model Service is configured on Linux server. When we publish any Page or Component the cache for `PageModel` and `EntityModel`s are not getting invalidated until we wait for around 1 hour or restart the Model Service. `Ecache-cli.config` is as below

```
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
        xmlns='http://www.ehcache.org/v3'
        xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.1.xsd">

    <cache-template name="default">
        <expiry>
            <ttl unit="seconds">3600</ttl>
        </expiry>
        <heap unit="entries">10000</heap>
    </cache-template>

    <cache alias="sitemaps" uses-template="default"/>
    <cache alias="pageModels" uses-template="default"/>
    <cache alias="entityModels" uses-template="default"/>
    <cache alias="config" uses-template="default"/>
    <cache alias="defaultCache" uses-template="default"/>
</config>

```

Answer: 
The DXA Model Service uses CIL caching. This cache is not triggered to invalidate entries when a page or component presentation is published or unpublished. It is a purely autonomous, time-based caching mechanism.
Alternatively, you can setup the ActiveMQ cache on Content Service for triggering to invalidating the entries when a page or component presentation is published or unpublished to clear the caching immediately also needs deployer to enable ActiveMQ caching configuration. In this case, in your DXA web app, you can keep the TTL cache settings value minimum, since it's cache on CIS service level still you can achieve high performance.

Refer to my blog article for [How to setup ActiveMQ caching on CIS](https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/tridion-developer/b/feed/posts/how-to-connect-sdl-web-8-content-interaction-service-cis-with-activemq)