Quantcast

Can squid work as http response parse only ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can squid work as http response parse only ?

钱国正
I know squid+ecap can modify http response with a relatively fast speed, and I have done that before.
But, in real environment, there is a lot of reqeusts, that don't need processs http response, which would make network slow.
So I am thinking whether I can use libnetfilter_queue to judge that http response has content-type with text/html , if it has such
things, we can redirect the packet to squid or some http parser, then modify it and send it to client.

I don't know whether it can work, if not, can anyone give me some advice.
if it can work like that, how to configure ?
Thanks a lot.
 

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can squid work as http response parse only ?

Amos Jeffries
Administrator
On 21/04/17 15:37, 钱国正 wrote:

> I know squid+ecap can modify http response with a relatively fast
> speed, and I have done that before.
> But, in real environment, there is a lot of reqeusts, that don't need
> processs http response, which would make network slow.
> So I am thinking whether I can use libnetfilter_queue to judge that
> http response has content-type with text/html , if it has such
> things, we can redirect the packet to squid or some http parser, then
> modify it and send it to client.
>
> I don't know whether it can work, if not, can anyone give me some advice.

It cannot. If the request is not sent through Squid there is no way it
can correctly handle the response.

Amos

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can squid work as http response parse only ?

Alex Rousskov
On 04/20/2017 11:34 PM, Amos Jeffries wrote:
> On 21/04/17 15:37, 钱国正 wrote:
>> I know squid+ecap can modify http response with a relatively fast
>> speed, and I have done that before.
>> But, in real environment, there is a lot of reqeusts, that don't need
>> processs http response, which would make network slow.
>> So I am thinking whether I can use libnetfilter_queue to judge that
>> http response has content-type with text/html , if it has such
>> things, we can redirect the packet to squid or some http parser, then
>> modify it and send it to client.

>> I don't know whether it can work, if not, can anyone give me some advice.

> It cannot.

The "or some http parser" part can work AFAICT, but it would be very
difficult to do serious text/html adaptations at the TCP packet level.
Configuring Squid to be more selective about adaptations, and making
Squid generally faster may be a better overall direction.


> If the request is not sent through Squid there is no way it
> can correctly handle the response.

Agreed. That "some http parser" alternative would have to make
libnetfilter an eCAP host application (essentially), completely
bypassing Squid.

Alex.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can squid work as http response parse only ?

reinerotto
In reply to this post by 钱国正
Having developed a commercial stand-alone proxy for content adaption, usually it is set up as a parent proxy to squid, which only forwards 'suitable' traffic to this parent, by means of ACLs.
Other traffic is directly forwarded to origin server, like requests for *.jpg, for example.
You can set up a similar scenario with 2 squids, one of these doing content adaption via ecap.

Loading...