Hello,

  Finally, I've composed all the work I did this year about mod_proxy
  functionality as a dynamic content cache, into one patchset.
  This job was done during while developing and maintaining websites
  produced by http://web.masterskaya.ru (sorry, we have no english
  page yet). Those website include http://www.polit.ru, largest
  russian politics site, http://www.izvestia.ru, website of one of the
  major russian newspapers, and many, many others. We handle about
  1 000 000 http hits per day with common dual httpd model -
  lightweight frontend with mod_proxy and heavy backend with
  mod_perl.

  You can download diffs from here:
  http://web.masterskaya.ru/~ilya/xfire_patches.tar.gz

  DISCLAIMER
  
  I'm not responsible for any damage, lost profit, or any other
  disasters caused by the code.

  DESCRIPTION OF FIXES

  Fixes was done for apache version 1.3.9. But I think it should work
  with 1.3.4 and higher versions too. I've not tested it with versions
  other than 1.3.9, and I've not tested it on Win32 platform.

  1) Subtle problem with mod_include/mod_rewrite/mod_proxy.
     mod_include reports error when receiving response code other than
     HTTP_OK. So I've fixed mod_proxy so that it can return
     HTTP_NOT_MODIFIED only if request is not subrequest. Also, I've
     enabled mod_rewrite ruleflag [P] on subrequests.
     
  2) Large amount of reloads cause very high load on backend because
     requests bypass the cache. I've added IgnoreNoCache <filemask>
     directive to mod_proxy config. <Filemask> is a mask for frontend
     server URIs. When mask is matched, Pragma: no-cache header is
     being deleted from incoming file headers, so if cached data
     present, it would be returned instead of getting data from
     backend server.

  3) On site with a very high traffic, there's a real risk of
     simultaneous reloading of the same URI by numerous clients.
     This is also causes problems on backend, especially with
     complicated dynamically-generated pages. I've fixed this by
     adding mod_proxy directive NoConcurrentCacheUpdates (On|Off),
     and new scoreboard status SERVER_PROXY_READ. When the flag is on
     and expired data found, server first checks if this URI is being
     downloaded from upstream by any other child. If so, it returns
     expired data to client while 'downloading' child doing its job of
     updating the cache.

  4) I've added X-Real-IP header to present real IP to the backend
     server. I think that X-Forwarded-For is for REAL proxies, so I
     don't want to mess with it.

  5) I've replaced ExplainX macros in proxy_cache.c for ap_log_rerror
     API call. Seems that those macros don't work, dunno why...

   So, that is all and here it is. Enjoy.

Best regards,
 Ilya                          mailto:[EMAIL PROTECTED]

Reply via email to