[Catalyst] Requests get rendered twice.. TT-Template (View::HTML->process)

Martin Gillmaier gillmaus at googlemail.com
Tue Mar 6 15:09:12 GMT 2012


Thanks for your reply.

I couldn't imagine all the browsers do 2 requests. But I checked using =

Firefox::Tamper. There I see only one request to my controller/action, =

and one to the .css file. But still there are 2 Requests in the =

console-output.

*15:57:37.446[74ms][total 4163ms] Status: 200[OK]
GET http://buntu:3000/person/login Load Flags[LOAD_DOCUMENT_URI  =

LOAD_INITIAL_DOCUMENT_URI  ] Gr=F6=DFe des Inhalts[7723] Mime Type[text/htm=
l]
    Request Header:
       Host[buntu:3000]
       User-Agent[Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; =

rv:10.0.2) Gecko/20100101 Firefox/10.0.2]
       =

Accept[text/html,application/xhtml+xml,application/xml;q=3D0.9,*/*;q=3D0.8]
       Accept-Language[de-de,de;q=3D0.8,en-us;q=3D0.5,en;q=3D0.3]
       Accept-Encoding[gzip, deflate]
       DNT[1]
       Connection[keep-alive]
       Referer[http://buntu:3000/person/login]
       Cookie[expert_session=3D6f332e165af682b03622e1b74318d5a646e69a22]
    Response Header:
       Connection[close]
       Date[Tue, 06 Mar 2012 14:57:37 GMT]
       Content-Length[7723]
       Content-Type[text/html; charset=3Dutf-8]
       Last-Modified[37]
       112[2]
       57[15]
       6[2]
       65[0]
       =

Set-Cookie[expert_session=3D6f332e165af682b03622e1b74318d5a646e69a22; =

path=3D/; expires=3DTue, 06-Mar-2012 15:57:37 GMT; HttpOnly]
       Status[200]
       X-Catalyst[5.80022]

15:57:37.550[0ms][total 0ms] Status: pending[]
GET http://buntu:3000/static/css/common.css Load Flags[LOAD_NORMAL] =

Gr=F6=DFe des Inhalts[unknown] Mime Type[unknown]
    Request Header:
       Host[buntu:3000]
       User-Agent[Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; =

rv:10.0.2) Gecko/20100101 Firefox/10.0.2]
       Accept[text/css,*/*;q=3D0.1]
       Accept-Language[de-de,de;q=3D0.8,en-us;q=3D0.5,en;q=3D0.3]
       Accept-Encoding[gzip, deflate]
       DNT[1]
       Connection[keep-alive]
       Referer[http://buntu:3000/person/login]
       Cookie[expert_session=3D6f332e165af682b03622e1b74318d5a646e69a22]*

and the log says:

*[info] *** Request 11 (0.036/s) [1955] [Tue Mar  6 15:57:37 2012] ***
[debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in cookie
[debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
[debug] "GET" request for "person/login" from "192.168.56.1"
[debug] Path is "person/login"
[debug] Rendering template "person/login.tt"
[debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in cookie
[debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
[debug] Response Code: 200; Content-Type: text/html; charset=3Dutf-8; =

Content-Length: 7723
[info] Request took 0.037200s (26.882/s)
.------------------------------------------------------------+-----------.
| Action                                                     | Time      |
+------------------------------------------------------------+-----------+
| /auto                                                      | 0.002057s |
| /person/auto                                               | 0.001919s |
| /person/login                                              | 0.000186s |
| /end                                                       | 0.006611s |
|  -> expert::View::HTML->process                            | 0.005815s |
'------------------------------------------------------------+-----------'

[info] *** Request 12 (0.039/s) [1955] [Tue Mar  6 15:57:41 2012] ***
[debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in cookie
[debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
[debug] "GET" request for "person/login" from "192.168.56.1"
[debug] Path is "person/login"
[debug] Rendering template "person/login.tt"
[debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in cookie
[debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
[debug] Response Code: 200; Content-Type: text/html; charset=3Dutf-8; =

Content-Length: 7723
[info] Request took 0.077878s (12.841/s)
.------------------------------------------------------------+-----------.
| Action                                                     | Time      |
+------------------------------------------------------------+-----------+
| /auto                                                      | 0.002543s |
| /person/auto                                               | 0.001362s |
| /person/login                                              | 0.000109s |
| /end                                                       | 0.005176s |
|  -> expert::View::HTML->process                            | 0.004524s |
'------------------------------------------------------------+-----------'
*

Kind regards,
Martin




Am 06.03.12 15:44, schrieb Francisco Obispo:
> Could it be your browser attempting to pre-fetch content?
>
>
>
>
> On Mar 6, 2012, at 9:38 AM, Martin Gillmaier wrote:
>
>> Hello to All!
>>
>> First, I am a perl-programmer and I am about to accomplish my first cata=
lyst-project.
>> Catalyst is really nice and flexible, and I am happy to get used to it.
>> However, I kindly like you ask you about an issue, that I just can't und=
erstand and that is driving me mad:
>>
>> I view the debug output in the terminal/bash:
>> $>  script/expert_server.pl -r
>>
>> And each time I do a request to the browser, I see an output like this i=
n my bash:
>>
>> [info] *** Request 14 (0.560/s) [1678] [Tue Mar  6 15:12:59 2012] ***
>> [debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in co=
okie
>> [debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
>> [debug] "GET" request for "person/login" from "192.168.56.1"
>> [debug] Path is "person/login"
>> [debug] Rendering template "person/login.tt"
>> [debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in co=
okie
>> [debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
>> [debug] Response Code: 200; Content-Type: text/html; charset=3Dutf-8; Co=
ntent-Length: 7723
>> [info] Request took 0.077044s (12.980/s)
>> .------------------------------------------------------------+----------=
-.
>> | Action                                                     | Time     =
 |
>> +------------------------------------------------------------+----------=
-+
>> | /auto                                                      | 0.003336s=
 |
>> | /person/auto                                               | 0.002680s=
 |
>> | /person/login                                              | 0.000187s=
 |
>> | /end                                                       | 0.006762s=
 |
>> |  ->  expert::View::HTML->process                            | 0.005926=
s |
>> '------------------------------------------------------------+----------=
-'
>>
>> [info] *** Request 15 (0.600/s) [1678] [Tue Mar  6 15:12:59 2012] ***
>> [debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in co=
okie
>> [debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
>> [debug] "GET" request for "person/login" from "192.168.56.1"
>> [debug] Path is "person/login"
>> [debug] Rendering template "person/login.tt"
>> [debug] Found sessionid "6f332e165af682b03622e1b74318d5a646e69a22" in co=
okie
>> [debug] Restored session "6f332e165af682b03622e1b74318d5a646e69a22"
>> [debug] Response Code: 200; Content-Type: text/html; charset=3Dutf-8; Co=
ntent-Length: 7723
>> [info] Request took 0.026152s (38.238/s)
>> .------------------------------------------------------------+----------=
-.
>> | Action                                                     | Time     =
 |
>> +------------------------------------------------------------+----------=
-+
>> | /auto                                                      | 0.002289s=
 |
>> | /person/auto                                               | 0.001404s=
 |
>> | /person/login                                              | 0.000108s=
 |
>> | /end                                                       | 0.004584s=
 |
>> |  ->  expert::View::HTML->process                            | 0.003944=
s |
>> '------------------------------------------------------------+----------=
-'
>>
>> So I have the same rendering process twice. Always and everywhere. Even =
the install on the production-server (fastcgi) has the same problem.
>> This leads to several problems, as you will know. Can you tell me where =
to search for that issue or do you have an idea what the     problem might =
be?
>>
>> Regards,
>> Martin
>>
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.=
uk/
>> Dev site: http://dev.catalyst.perl.org/
> Francisco Obispo
> email: fobispo at isc.org
> Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
> PGP KeyID =3D B38DB1BE
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120306/06e88=
b09/attachment.htm


More information about the Catalyst mailing list