开发者

Static content from my local django server loads incredibly slowly when using an domain aliased to localhost, vs. localhost itself

I've added the domain to my /etc/hosts/ file, and my site resolves, however static content is loading painfully slow. I'm talking 30 seconds for a page that normally takes 0.8s from localhost. I have no idea why this is, and it's killing my workflow. I actually formatted my machine to see if that开发者_如何学C would resolve but still no luck. This is on the latest version of Mac OS X.

So, http://localhost:8000 is great, very fast, while http://mydomain.com:8000 is painfully slow.

I can't use localhost or 127.0.0.1 because it's an application that uses Facebook connect, and they recently stopped allowing both of those as valid URLs for applications.

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0 localhost
127.0.0.1   mydomain.com


I'd test with the SimpleHTTPServer to see if the problem is related to Django or not:

python -m SimpleHTTPServer
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜