Andreas,
sorry for bothering you :-)
I found your nice introduction to http-headers
(Apache-correct_headers-1.16) and want to ask you
some questions.
1. Do you have some examples on-line to illustrate
cache-friendly dynamical pages ?
2. I'm building server with fully dynamic content using
Apache, modperl and HTML::Mason and would like to implement
cache-friendly strategy you described. But I have some problem:
In Russia we have several encodings for russian language
( koi8-r - mostly Unix, win-1251 - mostly windows and several
others). Documents generated in native server's encoding and
translated to another encoding on-fly depending on several
parameters (user directly specify port number for example or
server understand on some logic (by User Agent string for example) what
encoding would be the best for user). If user directly selected
port number URL would changed, say http://some.host:8100/ for koi8-r
and http://some.host:8101/ for win-1251. In such situation there
are no problem with caching on proxy servers because URL's are different.
But in case when server automagically recognize encoding of client
URL stays the same for differnet encodings - just http://some.host/
and this cause a trouble with proxy. Suppose if user1 from windows machine
and user2 from Unix request the same document using the same proxy.
Then if user1 was the first and proxy caches document in win-1251 encoding
and user2 will get document from the proxy but in wrong encoding.
user2 could press <reload> button and gets proxy refresh document
now in koi8-r encoding and so on. This is a pain.
So here is my question: What's correct way to configure http header
in this situation ? Actually, the situation I described probably
would be closer to you if, for example, server generates content
depending on User Agent, no translation, just different design.
I see probable solution: Lets browser use local cache and when document
is expired lets proxy to revalidate it from server and not get it from cache.
It's already big win if user could use local cache.
I don't know how to realize this solution in frame of HTTP 1.0.
Most proxy support only HTTP 1.0. In my experiments I used
Apache's Expire and headers modules.
ExpiresByType text/html "access plus 2 hours"
and this enough for browsers to use local cache
but unfortunately
proxy servers also cache documents and I got the problem I described above.
Is it possible to separate proxy's cache and browser's cache using
http-headers ? Again using HTTP 1.0 ?
I search mailing lists and internet resources but didn't found
solution for my problem. I'm doing Cc: to modperl mailing list
in hope people already found the solution.
Best regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83