Re: [squid-users] Accelerating proxy not matching cgi files

From: Mateusz Buc <majster.blaster_at_gmail.com>
Date: Thu, 25 Aug 2011 11:38:14 +0200

2011/8/24 Amos Jeffries <squid3_at_treenet.co.nz>:
>
> Maybe. We would need to see the HTTP headers produced by gen.cgi to be sure.
> From the description of how index.cgi/gen.cgi interact I think it highly
> likely the lack of Cache-Control and Last-Modified information from gen.cgi
> is causing the cache algorithms to determine its unsafe to store.
>

I gained access to the code of gen.cgi and made few changes:

        printf("Cache-Control: max-age=600, s-maxage=300\n");
        printf("Last-Modified: %s\n",mdate);

It now fetches timestamp from the URL, parses it to appropriate format
and then outputs as Last-Modified header. Plus I added Cache-Control.
Results are noticable - now I get most of TCP_REFRESH_UNMODIFIED/304
on my test page (gen.cgi links don't change there, so all timestamps
remain the same all the time).

Thank you a lot for these suggestions!

However, I still can't make these URLs/images cached on my squid. Is
there any chance they can be served directly from squid cache when
they do not change? Right now I have reduced network bandwidth
obviously, but not sure about CPU load - it still takes almost the
same time to load URL (about 8 seconds).

Do you have any further tips?

-- 
[ Mateusz 'Blaster' Buc :: blaster@grex.org :: http://blast3r.info ]
[ There's no place like 127.0.0.1. :: +48 724676983 :: GG: 2937287 ]
Received on Thu Aug 25 2011 - 09:38:27 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 25 2011 - 12:00:02 MDT