Re: [squid-users] insert into cache

From: Mohsen Pahlevanzadeh <mohsen_at_pahlevanzadeh.org>
Date: Sat, 02 Jul 2011 15:07:58 +0430

I fill response.txt file with the following text:
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8

And append a html file which has 438 bytes which Content-Length says.
After it, i ran the following command:

cat response.txt |telnet squid_server 3128
the i got the following error:

HTTP/1.0 400 Bad Request
Server: squid/2.7.STABLE9
Date: Sat, 02 Jul 2011 10:22:56 GMT
Content-Type: text/html
Content-Length: 2957
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from debian
Via: 1.0 debian:3128 (squid/2.7.STABLE9)
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>
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: &quot;3f80f-1b6-3e1cb03b&quot;
Accept-Ranges: bytes
Content-Length: 19499
Connection: close
Content-Type: text/html; charset=UTF-8
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0
Transitional//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;!-- saved from url=(0027)http://wiki.qemu.org/Manual --&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
xml:lang=&quot;en&quot; lang=&quot;en&quot;
dir=&quot;ltr&quot;&gt;&lt;head&gt;&lt;meta
http-equiv=&quot;Content-Type&quot; content=&quot;text/html;
charset=UTF-8&quot;&gt;
                
                &lt;meta http-equiv=&quot;Content-Style-Type&quot;
content=&quot;text/css&quot;&gt;
                &lt;meta name=&quot;generator&quot; content=&quot;MediaWiki
1.15.1&quot;&gt;
                &lt;meta name=&quot;keywords&quot;
content=&quot;Manual,Documentation/9psetup,Documentation/CreateSnapshot,Documentation/Debugging,Documentation/GettingStartedDevelopers,Documentation/HardwareManuals,Documentation/ISAManuals,Documentation/Networking,Documentation/Platforms/PC,KQEMU,KQemu/Doc&quot;&gt;
                &lt;link rel=&quot;shortcut icon&quot;
href=&quot;http://wiki.qemu.org/favicon.ico&quot;&gt;
                &lt;link rel=&quot;search&quot;
type=&quot;application/opensearchdescription+xml&quot;
href=&quot;http://wiki.qemu.org/opensearch_desc.php&quot;
title=&quot;QEMU (en)&quot;&gt;
                &lt;link title=&quot;Creative Commons&quot; type=&quot;application/rdf
+xml&quot;
href=&quot;http://wiki.qemu.org/index.php?title=Manual&amp;action=creativecommons&quot; rel=&quot;meta&quot;&gt;
                &lt;link rel=&quot;copyright&quot;
href=&quot;http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt&quot;&gt;
</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 Sat, 02 Jul 2011 10:22:56 GMT by debian (squid/2.7.STABLE9)
</ADDRESS>
</BODY></HTML>

Do you have an idea what i add to http headers?

Yours,
Mohsen

zadeh wrote:
> Dear all,
>
> i have a squid server and separate server which has a million page from
> million URL,you know that i can insert page into cache via "squidclient
> MYURL",but it uses GET http command and download page,now i have this
> page and just wanna insert into cache(already downloaded), do you have
> solution?
>
> Yours,
> Mohsen
>
>

Received on Sat Jul 02 2011 - 10:38:25 MDT

This archive was generated by hypermail 2.2.0 : Sat Jul 02 2011 - 12:00:01 MDT