Using the squidclient to put a file into squid cache

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Using the squidclient to put a file into squid cache

yinglcs
Hi,

I am trying to use the squidclient to put a file into squid cache.

Like this:
./squidclient -P test.html http://www.test.com

But I get this error:
HTTP/1.0 411 Length Required
Server: squid/2.6.STABLE13
Date: Mon, 09 Jul 2007 05:20:31 GMT
Content-Type: text/html
Content-Length: 1224
Expires: Mon, 09 Jul 2007 05:20:31 GMT
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from [hidden email]
Via: 1.0 [hidden email]:3128 (squid/2.6.STABLE13)
Proxy-Connection: close

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to process the request:
<PRE>
GET / HTTP/1.0
Content-Length: 51
Accept: */*

</PRE>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Invalid Request
</STRONG>
</UL>

<P>
Some aspect of the HTTP Request is invalid.  Possible problems:
<UL>
<LI>Missing or unknown request method
<LI>Missing URL
<LI>Missing HTTP Identifier (HTTP/1.0)
<LI>Request is too large
<LI>Content-Length missing for POST or PUT requests
<LI>Illegal character in hostname; underscores are not allowed
</UL>
<P>Your cache administrator is <A HREF="mailto:webmaster">webmaster</A>.

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Mon, 09 Jul 2007 05:20:31 GMT by [hidden email]
(squid/2.6.STABLE13)
</ADDRESS>
</BODY></HTML>
Reply | Threaded
Open this post in threaded view
|

Re: Using the squidclient to put a file into squid cache

RW-8
ying lcs wrote:

> Hi,
>
> I am trying to use the squidclient to put a file into squid cache.
>
> Like this:
> ./squidclient -P test.html http://www.test.com

That command is for uploading a file to a remote server through squid.

I'm guessing that what you trying to do is create a fake cache entry. AFAIK
you can't do that with squidclient. Possibly what you need is a squid
redirector to rewrite requests instead. There are a number of these, try
google.



Reply | Threaded
Open this post in threaded view
|

Re: Re: Using the squidclient to put a file into squid cache

yinglcs
On 7/9/07, RW <[hidden email]> wrote:

> ying lcs wrote:
>
> > Hi,
> >
> > I am trying to use the squidclient to put a file into squid cache.
> >
> > Like this:
> > ./squidclient -P test.html http://www.test.com
>
> That command is for uploading a file to a remote server through squid.
>
> I'm guessing that what you trying to do is create a fake cache entry. AFAIK
> you can't do that with squidclient. Possibly what you need is a squid
> redirector to rewrite requests instead. There are a number of these, try
> google.
>

Thanks. I have looked at these squid redirector:
http://www.squidguard.org/Doc/
http://squirm.foote.com.au/

none of them allows me to upload a file to squid cache .

Can you please tell me if I am missing anything?

Thank you.



>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Re: Using the squidclient to put a file into squid cache

RW-8
ying lcs wrote:

> On 7/9/07, RW <[hidden email]> wrote:
>> ying lcs wrote:
>>
>> > Hi,
>> >
>> > I am trying to use the squidclient to put a file into squid cache.
>> >
>> > Like this:
>> > ./squidclient -P test.html http://www.test.com
>>
>> That command is for uploading a file to a remote server through squid.
>>
>> I'm guessing that what you trying to do is create a fake cache entry.
>> AFAIK you can't do that with squidclient. Possibly what you need is a
>> squid redirector to rewrite requests instead. There are a number of
>> these, try google.
>>
>
> Thanks. I have looked at these squid redirector:
> http://www.squidguard.org/Doc/
> http://squirm.foote.com.au/
>
> none of them allows me to upload a file to squid cache .

They don't but they allow squid to replace one url with another so you can
substitute your file for the one on the remote webserver.


Reply | Threaded
Open this post in threaded view
|

Re: Using the squidclient to put a file into squid cache

Henrik Nordström
In reply to this post by yinglcs
mån 2007-07-09 klockan 00:39 -0500 skrev ying lcs:

> I am trying to use the squidclient to put a file into squid cache.

You can't. You can only use squidclient to ask Squid to fetch a file to
be placed in the cache..

If this needs to be fetched from a different location than normal
accesses then see cache_peer + cache_peer_access..

Regards
Henrik

signature.asc (316 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using the squidclient to put a file into squid cache

yinglcs
On 7/9/07, Henrik Nordstrom <[hidden email]> wrote:

> mån 2007-07-09 klockan 00:39 -0500 skrev ying lcs:
>
> > I am trying to use the squidclient to put a file into squid cache.
>
> You can't. You can only use squidclient to ask Squid to fetch a file to
> be placed in the cache..
>
> If this needs to be fetched from a different location than normal
> accesses then see cache_peer + cache_peer_access..
>

Thanks but my understand is cache_peer + cache_peer _access can only
access/load files from caches in other squid server.

In my case, I want to put a local file to the squid cache. That is
kind of different.

I appreciate if you can give me more pointers to achieve what I want.

Thank you.



> Regards
> Henrik
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Using the squidclient to put a file into squid cache

Henrik Nordström
On mån, 2007-07-09 at 17:55 -0500, ying lcs wrote:

> Thanks but my understand is cache_peer + cache_peer _access can only
> access/load files from caches in other squid server.

other HTTP servers.. does not need to be proxies.

> In my case, I want to put a local file to the squid cache. That is
> kind of different.

Is it? Someone needs to wrap it in HTTP, which is quite well done by an
HTTP server..

Regards
Henrik

signature.asc (316 bytes) Download Attachment