Pergunta

While checking the page speed, Google Page speed suggested me to "Leverage Browser Caching". As I enabled the caching in my MVC application using this code in .config file.

<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00"/>

After this, caching for static content which comes from my own domain is being cached, yet it is working.

However, static resources which comes from external domains are not being cached. For example: mydomain.com/content/scripts/somescript.js --> BEING CACHED http://widget.uservoice.com/ha3YmZucx5RAYmq2cS9qw.js --> NOT BEING CACHED

Google is still suggesting me to "Leverage Browser Caching" for that reason.

How can I enable my application to cache static resources which comes from external domains?

Foi útil?

Solução

You can't cache static resources from third-party domain; that's not how things work. If there's third-party resources not being cached, that means that third-party has either directly chosen not to employ caching (it may need to be always up-to-date to function properly) or has neglected to implement caching. The only thing you can do about that is submit a ticket to the third-party and ask them to fix it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top