Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Issac Goldstand
Both responses look cachable. Not sure why mod_cache wouldn't be caching them... Erica Zhang wrote: > > 3) Do you think I need to use mod_file_cache ? I do not use it. NO. mod_file_cache simply mmaps static files' filehandles, enabling Apache to serve them much faster. The name is really misl

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Issac Goldstand
Correct. You'll start seeing subdirectories under you cacheroot immediately. You can also try turning up the log level to LogLevel debug and looking at the error_log for more hints. Issac Erica Zhang wrote: > For mod_cache, I just use mod_disk_cache instead of mod_mem_cache. Then > if the res

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
I tried to use apache 2.2.4. Then mod_cache could catch the reponses. So I do not need to develop a filter for this function. :-) Thanks a lot for your help. Erica Zhang wrote: OK. For javascript file, I could find the files of Header and Data under the directory of mod_disk_cache. For php

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
David, 1) I tried /gethint.php without any GET/POST parameters. I got nothing and it could not be cached even with force-caching directive. I do the same thing for clienthint.js. It could work and display the source code and could be cached. 2), The first part is the responses for clienthint

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread David Wortham
Erica, My only comments: either (1) the request parameters are killing mod_cache's desire to cache the file or (2) something is different in the headers between your JavaScript and PHP responses. I would: (1) Try requesting /gethint.php without any GET/POST parameters (your app should respond w

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
Yes. I changed the PHP script. Now I change them back and also set CacheIgnoreCacheControl On. And still could not work. For other questions, please see the my answers below. Thanks. David Wortham wrote: Erica, My observations of your headers: (1) The "Last-Modified" line contains the curre

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
David, Well, I set CacheIgnoreCacheControl On not in a directory but just modules>, it still could not work. When I want to set it to be the directory of htdocs, httpd.conf could not pass the parser. Regards, Erica David Wortham wrote: Erica, I would follow Joachim's recommendation to: Y

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Joachim Zobel
Am Dienstag, den 06.03.2007, 14:41 -0800 schrieb Erica Zhang: > I use live http headers to catch the headers. I listed them below. Well > I found that php file has not been given the http headers. So is this > the problem for not caching the response produced by it ? Yes, see http://httpd.apach

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread David Wortham
Erica, My observations of your headers: (1) The "Last-Modified" line contains the current timestamp (as expected) (2) Your original question showed that you inserted an "Expires:" header, but it doesn't show in your response. Did you change your PHP script code since you asked the original ques

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
I use live http headers to catch the headers. I listed them below. Well I found that php file has not been given the http headers. So is this the problem for not caching the response produced by it ? Then how can I handle this problem ? Also, is there some mod_cache log that I could refer ? Tha

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
David, I printed out the response header, by use of xmlHttp.getAllResponseHeaders(), which could get the whole headers of the response. So through it, I could know that the headers have been added successfully to the responses. For mod_cache, I just use mod_disk_cache instead of mod_mem_cache

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread David Wortham
Erica, I would follow Joachim's recommendation to: You may want to use Firefox with the LiveHttpHeaders Plugin to look at the headers, that are actually exchanged (or are you already doing that). My coworker informs me that PHP automatically updates the "last updated" header line (to the current

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
Well, even I use the blinding-cache. It still could not work. Thanks, Erica David Wortham wrote: Erica, I'm not sure why mod_cache should not be able to work (assuming your module and pages are configured correctly). IIRC, JavaScript is used on the presentation request (with the webpage)

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Issac Goldstand
AFAIK, there's no reason that mod_cache shouldn't be able to cache your output, as long as the request is a GET and not POST, and not otherwise uncachable (eg, not authenticated, cache headers are present, expires in future, etc). It runs as an output filter, so the fact that the response is gener

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Joachim Zobel
Am Dienstag, den 06.03.2007, 11:42 -0800 schrieb Erica Zhang: > No, still not work. Infact, mod_cache could work, because it could cache > the javascript. But it could not work for dynamic HTTP responses > responding to XMLHttpRequests in Ajax technology. So I suspect mod_cache > could not suppo

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread David Wortham
Erica, I'm not sure why mod_cache should not be able to work (assuming your module and pages are configured correctly). IIRC, JavaScript is used on the presentation request (with the webpage), whereas the XMLHttpRequest response is a PHP-generated XML document. Perhaps your extension ('.php"

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Joe Lewis
Erica Zhang wrote: No, still not work. Infact, mod_cache could work, because it could cache the javascript. But it could not work for dynamic HTTP responses responding to XMLHttpRequests in Ajax technology. So I suspect mod_cache could not support this function. And I need provide such functio

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
No, still not work. Infact, mod_cache could work, because it could cache the javascript. But it could not work for dynamic HTTP responses responding to XMLHttpRequests in Ajax technology. So I suspect mod_cache could not support this function. And I need provide such function by myself. I prefe

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
Well, my question is not on the usage of mod_cache. In fact, I have used local applications to add caching headers and configure mod_cache to catch those HTTP responses. However I could not catch those HTTP responses. So I wonder if mod_cache could catch dynamic responses which are responding f

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Joachim Zobel
Am Montag, den 05.03.2007, 22:53 -0800 schrieb Erica Zhang: > 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 am not shure about mod_cache

Re: Just starting module development

2007-03-06 Thread Joe Lewis
Farokh Irani wrote: I'm trying to convert a plug-in that ran under WebSTAR as well as under Microsoft IIS to an Apache 2 module and I was wondering if anyone had any pointer or sample code that I should look at to make life easier. The WebSTAR code handles multiple threads (I haven't looked at

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Joe Lewis
Erica Zhang wrote: David, Thanks a lot for your reply. While, I just want to cache HTTP responses produced by PHP scripts. Of course, those responses perhaps include PHP scripts. On the other hand, I know I could do it by use of PHP itself. I just want to provide a general one. This means no

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread Erica Zhang
David, Thanks a lot for your reply. While, I just want to cache HTTP responses produced by PHP scripts. Of course, those responses perhaps include PHP scripts. On the other hand, I know I could do it by use of PHP itself. I just want to provide a general one. This means no matter what kind of

Re: Questions on modules to provide cache functions for Apache

2007-03-06 Thread David Wortham
Erica, IMO, your caching should take place on the PHP side of things, not Apache or any Apache modules (save for maybe mod_php). Depending on how frequently the cache should refresh, I would either have (1) PHP write the newest response to a file and check the timestamp of the file to check i