XHTML-CSS.com

This is our blog. It's mainly about programming, web developement and design, social web, coding habits and advice and miscellaneous geekery. You can subscribe to the feeds to never miss a bit.

On caching, excitement and stupidity

Permanant link —Nov 22, 01:51 PM

While discussing about caching in the W3C validator list, Olivier gave us his opinion on the subject of how to make the validator fast using some internal caching. He told us about bug #4998 and why the validator is requesting pages using "Cache-Control: max-age=0". And I was about sending the answer below... happily I didn't :)

> On 22 nov. 07, at 06:53, Karim A. wrote: I actually don't agree with bug 4998.
IMHO it's not a bug at all.
Why? Because it's up to the server to decide for what it will be used.

> On 11/22/07, olivier Thereaux <ot@w3.org> wrote: Note that you have to take into account intermediate caching proxies. I believe that was the original reason for this.

I see, Olivier, but it's the remote-thing's responsability to know that this specific client is THE validator and hence needs a fresh version of the page. The validator doesn't -and has not to know- that the server has a "front-end" cache. For the validator, the real server is the combination "server-cache".

Let me explain my thoughts with this example, and please correct me if I'm wrong:

CASE 1- (The one before bug#4998 was reported)
  • The validator : Hi I'm the validator, gimme that page about cats
  • The server: Don't bother, talk with my cache
  • The cache: Aloha, I'm the cache, and I'm deaf. Tell me what you want.

Not a very nice dialog. And the solution that's currently adopted is the easiest one.

CASE 2- ( Bug#4998 is fixed)
  • The validator: Hi, I'm the validator and I want fresh content. To let know his majesty's visitors how valid you are.
  • The server: No matter who is it, dear cache, here's some fresh content. Give it to him.
  • The cache: Ok, Meister! I'll give him the fresh content.

What I don't really like in this, is that the validator plays the weak boy role. And the dialog should be:

CASE 1- (How things should IMHO be.)
  • The validator: Hi, I'm THE validator!
  • The cache: Meister! A guy named Validator wants to have the page about cats. It seems he's a king or something. I heard that if we want to be checked and get a good diagnostic, we must give him fresh content!
  • The server: Whooo! He's the validator! here's fresh content give it to him!
  • The cache: Ok, Meister! I'll give him the fresh content.

That's how the situation should be. Because the validator is a polite guy, he announces himself when asking for things. The server/proxy/cache/whatever know who's asking. So It's up to the remote machinery (server, cache whatever) to answer correctly.
-- END --

This IS what I call STUPIDITY!


Enjoyed this post? please subscribe to our feeds to stay informed.

Commenting is closed for this article.

« Previous post:
Next post: »