2

We are using freeswitch to make outbound calls. For performance and better quality we have installed its mod_http_cache. And its caching the file and working fine. But the problem is sometime we need to change some audio files and so we also need to update its specific entry in freeswitch cache. So that freeswitch won't play older version of that file from cache.

The mod_http_cache is having method called http_clear_cache which empty the whole cache. But I don't want to clear the whole cache. I want to remove specific entry from it.

One way is to find the specific file entry in cache folder and remove it manually, but that's not ideal when we need to update cache for more than one file.

Can someone suggest some better way for this?

Thanks.

Nikhil N
  • 4,507
  • 1
  • 35
  • 53

1 Answers1

0

Add file version or creation data to the filename. Change it on update. But you should also change the link to the updated file of course.

freele
  • 142
  • 7
  • Just found this [explanation](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=en#invalidating-and-updating-cached-responses) – freele Feb 05 '15 at 21:21
  • I haven't asked about http cache..it's `Freewitch` cache. – Nikhil N Feb 06 '15 at 05:39
  • The principle is the same. The key phrase is `So, how do we get the best of both worlds: client-side caching and quick updates? Simple, we can change the URL of the resource and force the user to download the new response whenever its content changes. Typically, this is done by embedding a fingerprint of the file, or a version number, in its filename - e.g. style.x234dff.css.` It works regardless of the client type or content type... – freele Feb 06 '15 at 06:06