Changeset 2558 in subversion


Ignore:
Timestamp:
May 28, 2009 4:19:02 PM (4 years ago)
Author:
thomasb
Message:

Speedup UI by using CSS sprites and etags/expires/deflate for static files

Location:
trunk/roundcubemail
Files:
7 added
20 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/.htaccess

    r2478 r2558  
    2929RewriteRule ^favicon.ico$ skins/default/images/favicon.ico 
    3030</IfModule> 
    31   
     31 
     32<IfModule mod_deflate.c> 
     33SetOutputFilter DEFLATE 
     34</IfModule> 
     35 
     36<IfModule mod_headers.c> 
     37# replace 'append' with 'merge' for Apache version 2.2.9 and later 
     38Header append Cache-Control public env=!NO_CACHE 
     39</IfModule> 
     40 
     41<IfModule mod_expires.c> 
     42ExpiresActive On 
     43ExpiresDefault "access plus 1 month" 
     44</IfModule> 
     45 
     46FileETag MTime 
     47 
    3248Order deny,allow 
    3349Allow from all 
  • trunk/roundcubemail/CHANGELOG

    r2540 r2558  
    22=========================== 
    33 
     4- Speedup UI by using CSS sprites and etags/expires/deflate in Apache config (#1484858,#1485800) 
    45- Support UID EXPUNGE: remove only moved/deleted messages 
    56- Add drag cancelling with ESC key (#1484344) 
  • trunk/roundcubemail/INSTALL

    r2449 r2558  
    7676 
    7777# sqlite -init SQL/sqlite.initial.sql sqlite.db 
     78Loading resources from SQL/sqlite.initial.sql 
     79SQLite version 2.8.16 
     80Enter ".help" for instructions 
     81sqlite> .exit 
     82# chmod o+rw sqlite.db 
    7883 
    7984Make sure your configuration points to the sqlite.db file and that the 
     
    120125 
    121126 
     127OPTIMISING 
     128========== 
     129 
     130There are two forms of optimisation here, compression and caching, both aimed 
     131at increasing an end user's experience using RoundCube Webmail. Compression 
     132allows the static web pages to be delivered with less bandwidth. The index.php 
     133of RoundCube Webmail already enables compression on its output. The settings 
     134below allow compression to occur for all static files. Caching sets HTTP  
     135response headers that enable a user's web client to understand what is static 
     136and how to cache it. 
     137 
     138The caching directives used are: 
     139 * Etags - sets at tag so the client can request is the page has changed 
     140 * Cache-control - defines the age of the page and that the page is 'public' 
     141   This enables clients to cache javascript files that don't have private  
     142   information between sessions even if using HTTPS. It also allows proxies 
     143   to share the same cached page between users. 
     144 * Expires - provides another hint to increase the lifetime of static pages. 
     145 
     146For more information refer to RFC 2616. 
     147 
     148Side effects: 
     149------------- 
     150These directives are designed for production use. If you are using this in 
     151a development environment you may get horribly confused if your webclient 
     152is caching stuff that you changed on the server. Disabling the expires  
     153parts below should save you some grief. 
     154 
     155If you are changing the skins, it is recommended that you copy content to  
     156a different directory apart from 'default'. 
     157 
     158Apache: 
     159------- 
     160To enable these features in apache the following modules need to be enabled: 
     161 * mod_compress 
     162 * mod_expire 
     163 * mod_headers 
     164 
     165The optimisation is already included in the .htaccess file in the top  
     166directory of your installation. 
     167 
     168If you are using Apache version 2.2.9 and later, in the .htaccess file 
     169change the 'append' word to 'merge' for a more correct response. Keeping 
     170as 'append' shouldn't cause any problems though changing to merge will  
     171eliminate the possibility of duplicate 'public' headers in Cache-control. 
     172 
     173Lighttpd: 
     174--------- 
     175With Lightty the addition of Expire: tags by mod_expire is incompatible with 
     176the addition of "Cache-control: public". Using Cache-control 'public' is  
     177used below as it is assumed to give a better caching result. 
     178 
     179Enable modules in server.modules: 
     180    "mod_setenv" 
     181    "mod_compress" 
     182 
     183Mod_compress is a server side cache of compressed files to improve its performance. 
     184 
     185$HTTP["host"] == "www.example.com" { 
     186 
     187    static-file.etags = "enable" 
     188    # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails 
     189    etag.use-mtime = "enable" 
     190 
     191    # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv 
     192    $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" { 
     193        setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000") 
     194    } 
     195 
     196    # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress 
     197    # set compress.cache-dir to somewhere outside the docroot. 
     198    compress.cache-dir   = var.statedir + "/cache/compress" 
     199 
     200    compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png") 
     201} 
     202 
     203 
  • trunk/roundcubemail/skins/default/addresses.css

    r2541 r2558  
    172172  font-size: 11px; 
    173173  font-weight: bold; 
    174   background-color: #EBEBEB; 
    175   background-image: url(images/listheader_aqua.gif); 
     174  background: url('images/listheader.gif') top left repeat-x #CCC; 
    176175  white-space: nowrap; 
    177176} 
  • trunk/roundcubemail/skins/default/common.css

    r2551 r2558  
    152152} 
    153153 
    154 #taskbar a, 
    155 #taskbar a:active, 
    156 #taskbar a:visited 
     154#taskbar a 
    157155{ 
    158156  font-size: 11px; 
     
    160158  text-decoration: none; 
    161159  padding: 6px 14px 6px 27px; 
    162   background-repeat: no-repeat; 
     160  background: url('images/taskicons.gif') no-repeat; 
    163161} 
    164162 
     
    168166} 
    169167 
    170 a.button-mail 
    171 { 
    172   background-image: url(images/buttons/mail.gif); 
    173 } 
    174  
    175 a.button-addressbook 
    176 { 
    177   background-image: url(images/buttons/addressbook.gif); 
    178 } 
    179  
    180 a.button-settings 
    181 { 
    182   background-image: url(images/buttons/settings.gif); 
    183 } 
    184  
    185 a.button-logout 
    186 { 
    187   background-image: url(images/buttons/logout.gif); 
     168#taskbar a.button-mail 
     169{ 
     170  background-position: 0 0; 
     171} 
     172 
     173#taskbar a.button-addressbook 
     174{ 
     175  background-position: 0 -25px; 
     176} 
     177 
     178#taskbar a.button-settings 
     179{ 
     180  background-position: 0 -50px; 
     181} 
     182 
     183#taskbar a.button-logout 
     184{ 
     185  background-position: 0 -75px; 
    188186} 
    189187 
     
    204202  width: 400px; 
    205203  margin: 0px auto; 
    206   height: 24px; 
    207   min-height: 24px; 
     204  height: 22px; 
     205  min-height: 22px; 
    208206  padding: 8px 10px 8px 46px; 
    209207} 
     
    212210#remote-objects-message 
    213211{ 
    214   background: url(images/display/info.png) 6px 3px no-repeat; 
     212  background: url('images/display/icons.png') 6px 3px no-repeat; 
    215213  background-color: #F7FDCB; 
    216214  border: 1px solid #C2D071; 
     
    220218#message div.warning 
    221219{ 
    222   background: url(images/display/warning.png) 6px 3px no-repeat; 
     220  background: url('images/display/icons.png') 6px -97px no-repeat; 
    223221  background-color: #EF9398; 
    224222  border: 1px solid #DC5757; 
     
    227225#message div.confirmation 
    228226{ 
    229   background: url(images/display/confirm.png) 6px 3px no-repeat; 
     227  background: url('images/display/icons.png') 6px -47px no-repeat; 
    230228  background-color: #A6EF7B; 
    231229  border: 1px solid #76C83F; 
     
    234232#message div.loading 
    235233{ 
    236   background: url(images/display/loading.gif) 6px 3px no-repeat; 
     234  background: url('images/display/loading.gif') 6px 3px no-repeat; 
    237235  background-color: #EBEBEB; 
    238236  border: 1px solid #CCCCCC; 
     
    275273  font-size: 11px; 
    276274  font-weight: bold; 
    277   background-color: #EBEBEB; 
    278   background-image: url(images/listheader_aqua.gif); 
     275  background: url('images/listheader.gif') top left repeat-x #CCC; 
    279276} 
    280277 
     
    288285  border-bottom: 1px solid #999999; 
    289286  color: #333333; 
    290   background-color: #EBEBEB; 
    291   background-image: url(images/listheader_aqua.gif);  
     287  background: url('images/listheader.gif') top left repeat-x #CCC; 
    292288  font-size: 11px; 
    293289  font-weight: bold; 
  • trunk/roundcubemail/skins/default/ie6hacks.css

    r2543 r2558  
    44{ 
    55  behavior: url('skins/default/pngbehavior.htc'); 
     6} 
     7 
     8#message div.notice, 
     9#message div.error, 
     10#message div.warning, 
     11#message div.confirmation, 
     12#remote-objects-message 
     13{ 
     14  background-image: url(images/display/icons.gif); 
    615} 
    716 
     
    1625} 
    1726 
    18  
     27#mailboxlist li 
     28{ 
     29  background-image: url('images/icons/folders.gif'); 
     30} 
  • trunk/roundcubemail/skins/default/mail.css

    r2541 r2558  
    342342  margin: 0; 
    343343  padding: 3px 10px 4px 10px; 
    344   background-color: #EBEBEB; 
    345   background-image: url(images/listheader_aqua.gif);  
     344  background: url('images/listheader.gif') top left repeat-x #CCC; 
    346345  border-bottom: 1px solid #999; 
    347346  color: #333333; 
     
    379378  position: relative; 
    380379  font-size: 11px; 
    381   background: url(images/icons/folder-closed.png) no-repeat; 
    382   background-position: 5px 1px; 
     380  background: url('images/icons/folders.png') 5px 1px no-repeat; 
    383381  border-bottom: 1px solid #EBEBEB; 
    384382} 
     
    402400#mailboxlist li div.collapsed 
    403401{ 
    404   background: url(images/icons/collapsed.png) bottom right no-repeat; 
     402  background: url('images/icons/collapsed.png') bottom right no-repeat; 
    405403} 
    406404 
    407405#mailboxlist li div.expanded 
    408406{ 
    409   background: url(images/icons/expanded.png) bottom right no-repeat; 
     407  background: url('images/icons/expanded.png') bottom right no-repeat; 
    410408} 
    411409 
    412410#mailboxlist li.inbox 
    413411{ 
    414   background-image: url(images/icons/folder-inbox.png); 
     412  background-position: 5px -15px; 
    415413} 
    416414 
    417415#mailboxlist li.drafts 
    418416{ 
    419   background-image: url(images/icons/folder-drafts.png); 
     417  background-position: 5px -31px; 
    420418} 
    421419 
    422420#mailboxlist li.sent 
    423421{ 
    424   background-image: url(images/icons/folder-sent.png); 
     422  background-position: 5px -47px; 
    425423} 
    426424 
    427425#mailboxlist li.junk 
    428426{ 
    429   background-image: url(images/icons/folder-junk.png); 
     427  background-position: 5px -63px; 
    430428} 
    431429 
    432430#mailboxlist li.trash 
    433431{ 
    434   background-image: url(images/icons/folder-trash.png); 
     432  background-position: 5px -79px; 
    435433} 
    436434 
     
    538536  border-bottom: 1px solid #999999; 
    539537  color: #333333; 
    540   background-color: #EBEBEB; 
    541   background-image: url(images/listheader_aqua.gif);  
     538  background: url('images/listheader.gif') top left repeat-x #CCC; 
    542539  font-size: 11px; 
    543540  font-weight: bold; 
     
    547544#messagelist thead tr td.sortedDESC 
    548545{ 
    549   background-image: url(images/listheader_dark.gif);  
     546  background-position: 0 -20px; 
    550547} 
    551548 
    552549#messagelist thead tr td.sortedASC a 
    553550{ 
    554   background: url(images/sort_asc.gif) top right no-repeat; 
     551  background: url('images/icons/sort.gif') right 0 no-repeat; 
    555552} 
    556553 
    557554#messagelist thead tr td.sortedDESC a 
    558555{ 
    559   background: url(images/sort_desc.gif) top right no-repeat; 
     556  background: url('images/icons/sort.gif') right -14px no-repeat; 
    560557} 
    561558 
  • trunk/roundcubemail/skins/default/settings.css

    r2541 r2558  
    245245  font-size: 11px; 
    246246  font-weight: bold; 
    247   background-color: #EBEBEB; 
    248   background-image: url(images/listheader_aqua.gif);  
     247  background: url('images/listheader.gif') top left repeat-x #CCC; 
    249248} 
    250249 
Note: See TracChangeset for help on using the changeset viewer.