#8409: Django built-in server is very slow with Firefox browser when serving 
admin
media
------------------------------------+---------------------------------------
          Reporter:  andylowry      |         Owner:  nobody
            Status:  reopened       |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  1     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by anonymous):

  * status:  closed => reopened
  * has_patch:  0 => 1
  * resolution:  invalid =>

Comment:

 I understand that it's not built for speed, but the changes are trivial,
 and it makes a huge difference (1-second page load vs. about 10 seconds
 for a not terribly complicated admin page!).  I'm sure the dev server gets
 used very extensively, especially since the tutorial and two different
 projects books both walk through how to use it (albeit with caveats).  I'm
 reopening this because I think this is such a trivial change with a
 relatively big payoff that it's worth more serious consideration.  But I
 won't reopen again if I haven't changed your mind this time.

 Here are my changes (3 lines added to existing code):

 At top of basehttp.py:
 {{{
 #!html
 <pre>
     <span style="color: red;">import stat</span>
 </pre>
 }}}

 Later, in the {{{__call__}}} method:
 {{{
 #!html
 <pre>
                 status = '200 OK'
                 <span style="color: red;">mtime =
 os.stat(file_path)[stat.ST_MTIME]
                 headers = {'Last-Modified': http_date(mtime) }</span>
                 mime_type = mimetypes.guess_type(file_path)[0]
 </pre>
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8409#comment:2>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to