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 default configuration of all caches in the DXA source code is set on production/live values, to ensure the performance is optimal in case no changes are being made.

However, when you want to setup a development or staging environment with XPM, then you should disable these caches, as they indeed make you wait for up to an hour before your changes are visible.

Please note that [yesterday the DXA 2.0 GA version was released](https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/b/product-announcements/posts/sdl-releases-the-sdl-digital-experience-accelerator-2-0), so I strongly advise you to upgrade to that, as the CTP releases were only meant as a preview, and you should no longer use them.

When you follow the documentation, and [install the Model Service](https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-2CF89E5B-D84C-498F-A65A-920EFC26A5A4) as described there, you will [notice](https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-0958B2BE-8F03-4C60-B93F-257EB301F2ED) you can specify a `deployType` parameter. Setting this to `Live` (default) or `Staging` will give you different cache settings automatically. 

If you want to configure everything manually, there is a [separate topic in the documentation](https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-C53D15E4-CFE9-4025-94E5-73143B657478) about caching and cache settings of the [web application](https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-ECC97962-A39B-4DD8-B218-621FA243C56A) and the [Model Service](https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-CC4CBF54-8221-44C8-9D91-DB59CD6487F1).
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.