how rails check and fetch Page Cache file?

It doesn't. Your web server's rewrite routes need to be written in a way that it checks for the existence of a file and serves it before even bothering rails. This is static-heavy sites like the main Rails site and weblog are blazing fast. Apache's doing the heavy lifting.

Rick Olson wrote:

> Your web server's rewrite routes need to be written in a > way that it checks for the existence of a file and serves it before > even bothering rails.

I'd tried to remove RewriteRule ^([^.]+)$ $1.html [QSA] from public/.htaccess, but mongrel(development env, without apache) still knew the cache files. It let me believe that the job was done inside the rails... so I was wrong...

Mongrel does the same thing too. When in doubt, watch your logs for rails requests.

Now I'll try to use apache's httpd.conf file. It surely can redirect to cache file. Before that, I need to learn complex rewrite rule for mod_rewrite... If you've done this before, can you give me a quick help? I need a apache mod_rewrite rule to rewrite /data/98 to /data/0/98.html and /data/89798 to /data/8/9798.html (/data/:id, ids are divided into two parts, four digitals for file name, left will be dir name.)

Why not just use the partitioned IDs in the rails routes themselves?

or you suggest instead of calling /data/89798, but using /data/8/9798 to fetch the data?

Yup.

I think apache rewrite is perfect to do this rewrite job. Faster at least.

Ok.