Slow response with static files (css, js files) solved!

261 views
Skip to first unread message

pragmatic

unread,
Nov 25, 2007, 5:01:07 PM11/25/07
to web.py
I was getting the problem of slow response (> 10 seconds) with files
in the static folder on Windows XP. Some on this forum had suggested
it was a NetBIOS issue. Wow, what a sidetrack.

The real problem is that files encoded Windows style (crlf) are not
served correctly. To replicate the issue simply use you favorite
advanced text editor to change the format from Windows to Unix. Watch
your response time drop from 10 seconsd to a few milliseconds.

Anyone know if that has been fixed?

In the meantime I'll have to setup GVIM to use unix line endings.

Regards

大郎

unread,
Nov 25, 2007, 8:00:41 PM11/25/07
to we...@googlegroups.com
if __name__ == "__main__":
    web.httpserver.runsimple = web.httpserver.runbasic
    web.run(urls, globals(), web.reloader)

# to add this: web.httpserver.runsimple = web.httpserver.runbasic, it will be ok, but i found it slow yestoday too, i don't know why.
--
最好的推广便是实际应用
最近在学习web.py, 坚持才能进步
http://del.icio.us/iexper
http://twitter.com/qichangxing
Gtalk: iexper(at)gmail.com

slav0nic

unread,
Nov 26, 2007, 5:45:18 AM11/26/07
to web.py
try use profiler and show result

On Nov 26, 3:00 am, "大郎" <iex...@gmail.com> wrote:
> if __name__ == "__main__":
> web.httpserver.runsimple = web.httpserver.runbasic
> web.run(urls, globals(), web.reloader)
>
> # to add this: web.httpserver.runsimple = web.httpserver.runbasic, it will
> be ok, but i found it slow yestoday too, i don't know why.
>

Kari Hoijarvi

unread,
Nov 26, 2007, 11:31:54 AM11/26/07
to we...@googlegroups.com
I ran to this too, but only with the development server.

The problem is, that content-length of text files is wrong if you have
windows style CR+LF ending.

Workaround: I changed my text files to use Unix style.

Where's the official page to report bugs?

Kari

see

unread,
Dec 4, 2007, 8:10:52 AM12/4/07
to web.py
> Where's the official page to report bugs?

I think this is not even web.py "fault" but a general problem in
Python 2.5. Getting a wrong Content-length with files using CR+LG is a
problem in Python's SimpleHTTPServer too, reason is somewhere in
module "os" as I remember correctly. I looked into it a while ago but
forgot (or better had not the time) to report it on Python dev. In
Python 2.4 this problem is not present. I guess it should work with
web.py also, anyone still using web.py in Py 2.4?

Chris

Aaron Swartz

unread,
Dec 4, 2007, 1:10:33 PM12/4/07
to we...@googlegroups.com
> Where's the official page to report bugs?

http://bugs.launchpad.net/webpy/+filebug

Reply all
Reply to author
Forward
0 new messages