Hi,

I want to develop a filter module to cache responses for XMLHttp requests for Apache. Before that, I have tried to configure using mod_cache. I found that it could not be used to cache responses for XMLHttp requests. However, I am not sure about this, because I am new to web applications. So before beginning to develop a new module to do this function, I want to make sure that. Is there some expert tell me about your idea on this topic or experiences ?

I tried to give more details below:

For mod_cache, I use httpd.conf to configure it:

MaxKeepAliveRequests 10000
<IfModule mpm_winnt.c>
   ThreadsPerChild 1900
   MaxRequestsPerChild 10000
</IfModule>

LoadModule cache_module modules/mod_cache.so

<IfModule mod_cache.c>
   CacheForceCompletion 100
   CacheDefaultEXPire 3600
   CacheMaxExpire 86400
   CacheLastModifiedFactor 0.1
   LoadModule disk_cache_module modules/mod_disk_cache.so

   <IfModule mod_disk_cache.c>
       CacheEnable disk /
       CacheRoot c:/cacheroot
       CacheSize 327680
       CacheDirLength 4
       CacheDirLevels 5
       CacheGcInterval 4
   </IfModule>

   #LoadModule mem_cache_module modules/mod_mem_cache.so
   <IfModule mod_mem_cache.c>
       CacheEnable mem /
       MCacheSize 8192
       MCacheMaxObjectCount 10000
       MCacheMinObjectSize 1
       MCacheMaxObjectSize 51200
   </IfModule>
</IfModule>

On client, I use ajax technology and XMLHttpRequest and on server, I use php script.
...
header("Cache-Control: public"); // HTTP/1.1
header("Expires: " .gmdate ("D, d M Y H:i:s", time() + 60 * 10). " GMT");
header( "Last-Modified: " .gmdate( 'D, d M Y H:i:s' ). " GMT" );
echo $response;
....
I think apache cache should catch my response produced by PHP. Until now, I do not think there is something wrong in my code or configuration. So I conclude that mod_cache could not catch the responses for XMLHttp requests.

Regards,

Erica


Reply via email to