Skip to content

Commit

Permalink
Optimize the content type search.
Browse files Browse the repository at this point in the history
Move most commonly used types to the top
of the list.  This reduces the time spent
iterating content types.
  • Loading branch information
markstory committed May 10, 2012
1 parent 37d235f commit 2c1b5d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -80,6 +80,10 @@ class CakeResponse {
* @var array
*/
protected $_mimeTypes = array(
'html' => array('text/html', '*/*'),
'json' => 'application/json',
'xml' => array('application/xml', 'text/xml'),
'rss' => 'application/rss+xml',
'ai' => 'application/postscript',
'bcpio' => 'application/x-bcpio',
'bin' => 'application/octet-stream',
Expand Down Expand Up @@ -206,7 +210,6 @@ class CakeResponse {
'f90' => 'text/plain',
'h' => 'text/plain',
'hh' => 'text/plain',
'html' => array('text/html', '*/*'),
'htm' => array('text/html', '*/*'),
'ics' => 'text/calendar',
'm' => 'text/plain',
Expand All @@ -218,7 +221,6 @@ class CakeResponse {
'tpl' => 'text/template',
'txt' => 'text/plain',
'text' => 'text/plain',
'xml' => array('application/xml', 'text/xml'),
'avi' => 'video/x-msvideo',
'fli' => 'video/x-fli',
'mov' => 'video/quicktime',
Expand Down Expand Up @@ -261,12 +263,10 @@ class CakeResponse {
'pdb' => 'chemical/x-pdb',
'xyz' => 'chemical/x-pdb',
'javascript' => 'text/javascript',
'json' => 'application/json',
'form' => 'application/x-www-form-urlencoded',
'file' => 'multipart/form-data',
'xhtml' => array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
'xhtml-mobile' => 'application/vnd.wap.xhtml+xml',
'rss' => 'application/rss+xml',
'atom' => 'application/atom+xml',
'amf' => 'application/x-amf',
'wap' => array('text/vnd.wap.wml', 'text/vnd.wap.wmlscript', 'image/vnd.wap.wbmp'),
Expand Down

0 comments on commit 2c1b5d9

Please sign in to comment.