On 2016-03-19 04:50, Waitman Gobble wrote:

On 2016-03-18 01:00, Amos Jeffries wrote:

On 18/03/2016 3:46 a.m., Waitman Gobble wrote:

When a script reference on an HTML page includes a parameter, the script
does not appear to be cached when using squid in accel mode (https).

For example,
<script type='text/javascript'
src='/wp-includes/js/jquery/jquery.js?ver=1.1.13'></script>

jquery.js does not appear to be cached in that case, each page request
hits the originserver with a request for jquery.js. (also seems browser
does not cache, either).
How are you determining that?

Dynamic content (as signalled by the '?query-string') is expected to
revalidate on each use unless that origin has sent explicit cacheability headers. In HTTP/1.1 contact with the origin server is not always a full
fetch.

I was watching HTTP logs on origin server, every page request was also creating request for css, js, etc.

waitman.net - [19/Mar/2016:03:47:04 -0700] "GET /wp-content/themes/mh-magazine-lite/style.css?ver=2.1.2 HTTP/1.1" 200 38550 "-"

After removing ?ver from html page, there was initial request:

waitman.net - [19/Mar/2016:03:50:15 -0700] "GET /wp-content/themes/mh-magazine-lite/style.css HTTP/1.1" 200 38550 "-"

but after that it was served from cache and no more hits on origin.

Perhaps it was not doing a "full request", but I was looking at the content length in the logs, 38550

Removing parameters from html allows the scripts to be cached, but I'm
wondering if there is a configuration to cache the scripts even with
parameter spec? In this case it's only a couple of minor modifications
to wp source, but it would be more convenient to avoid mod altogether.

Also, I noticed that when requesting content through squid in proxy mode
(not accel), with SSL request - a newline (\r\n) is appearing in the
header *before* the status, ie HTTP/1.1 200 OK. This does not happen
with http/80 requests. I haven't tested this thoroughly to be certain
that it's a problem in squid, but maybe you have an idea if it's
happening in the code? Something to consider. (Note: It could also be a
problem with libcurl, if squid is not the culprit).

Thats odd. Can you grab a packet trace between the two to figure that out?

Yes, I will check it out and see where the newline is coming from.
I'm in Boston for the LibrePlanet weekend but can check it out next week.








I made a little test program and now I see what's going on, maybe this isn't actually a squid problem.. It's returning
'HTTP/1.1 200 Connection established'
through proxy SSL , then a space, then the actual headers. The other day I did not realize that first header line in my program :)


test program: http://git.cloudqx.com/snippets/2

test results:


https://waitman.net through proxy

# ./testsquid
HTTP/1.1 200 Connection established

HTTP/1.1 200 OK
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Powered-By: PHP/7.0.4
Content-Type: text/html; charset=UTF-8
X-Pingback: https://waitman.net/xmlrpc.php
Link: <https://waitman.net/wp-json/>; rel="https://api.w.org/";
Link: <https://waitman.net/>; rel=shortlink
Transfer-Encoding: chunked
Date: Wed, 23 Mar 2016 15:10:49 GMT
Server: Syntax error on line 110

<!DOCTYPE html>


http://waitman.net through proxy

# ./testsquid
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Powered-By: PHP/7.0.4
Content-Type: text/html; charset=UTF-8
X-Pingback: https://waitman.net/xmlrpc.php
Link: <https://waitman.net/wp-json/>; rel="https://api.w.org/";
Link: <https://waitman.net/>; rel=shortlink
Date: Wed, 23 Mar 2016 15:11:45 GMT
Server: Syntax error on line 110
X-Cache: MISS from ob4.cloudqx.com
Transfer-Encoding: chunked
Via: 1.1 ob4.cloudqx.com (squid/3.5.15-20160302-r14000)
Connection: keep-alive



https://waitman.net/pagedoesnotexist through proxy

# ./testsquid
HTTP/1.1 200 Connection established

HTTP/1.1 404 Not Found
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Powered-By: PHP/7.0.4
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
Link: <https://waitman.net/wp-json/>; rel="https://api.w.org/";
Transfer-Encoding: chunked
Date: Wed, 23 Mar 2016 15:17:50 GMT
Server: Syntax error on line 110

<!DOCTYPE html>





change test to go through accel


struct curl_slist *host = NULL;
host = curl_slist_append(NULL, "waitman.net:443:127.0.0.1");
curl_easy_setopt(conn, CURLOPT_RESOLVE, host);


https://waitman.net through accel

# ./testsquid
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Powered-By: PHP/7.0.4
Content-Type: text/html; charset=UTF-8
X-Pingback: https://waitman.net/xmlrpc.php
Link: <https://waitman.net/wp-json/>; rel="https://api.w.org/";
Link: <https://waitman.net/>; rel=shortlink
Date: Wed, 23 Mar 2016 15:15:49 GMT
Server: Syntax error on line 110
X-Cache: MISS from ob4.cloudqx.com
Transfer-Encoding: chunked
Via: 1.1 ob4.cloudqx.com (squid/3.5.15-20160302-r14000)
Connection: keep-alive

<!DOCTYPE html>














version info:

Squid Cache: Version 3.5.15-20160302-r14000
Service Name: squid
configure options:  '--prefix=/usr/local/squid' '--with-openssl=/usr'
--enable-ltdl-convenience

FreeBSD 10.2-RELEASE-p9 FreeBSD 10.2-RELEASE-p9 #0:

Thanks,

--
Waitman Gobble
Los Altos CA USA
+1 650 900 8557

_______________________________________________
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users
_______________________________________________
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users

Reply via email to