Domanda

I have read an article here but I don't understand exactly how to configure it as described. Actually what I want is serving images fast using wither memory or desk - I have searched and tried to configure it but none of them worked as I expected. I also searched in this community but again I haven't found an answer although there are many posts on this subject.

My previous configuration as follows:

  <IfModule mod_cache.c>
    LoadModule cache_disk_module /usr/lib/apache2/modules/mod_cache_disk.so
    <IfModule mod_mem_cache.c>
      CacheEnable mem /
      MCacheSize 4096
      MCacheMaxObjectCount 100
      MCacheMinObjectSize 1
      MCacheMaxObjectSize 2048
   </IfModule>
</IfModule>

It is not working. Please could you help to understand what is wrong?

Thanks

È stato utile?

Soluzione

I would recommend to use mod_disk_cache as it would be faster than mod_mem_cache. Please try below settings.

<IfModule mod_cache.c>
LoadModule cache_disk_module /usr/lib/apache2/modules/mod_cache_disk.so
<IfModule mod_disk_cache.c>
CacheDefaultExpire 3600
CacheEnable disk /
CacheRoot "/path/to/cache/folder/"
CacheDirLevels 2
CacheDirLength 1
</IfModule>
</IfModule>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top