[livesupport-dev] admin interface speed
  • --=====================_105323967==_
    Content-Type: text/plain; charset="us-ascii"; format=flowed

    possibly for future admin interfaces, we should include the little icons
    into the php source code (see below)? this function *generates* gif images
    from ascii... yehaa. how is that for speed? (don't know actually). i found
    this in one of my favourite one page php scripts ever: webadmin. and
    attached three example gifs.

    the webadmin site:
    http://cker.name/webadmin/



    function getImage ($iid) {

    /* escaped strings powered by bin2string.php */
    switch ($iid) {
    case 1: return
    "GIF89a\23\0\22\0\xa2\4\0\0\0\0\xff\xff\xff\xcc\xcc\xcc\x99\x99\x99\xff\xff\xff\0\0\0\0\0\0\0\0\0!\xf9\4\1\xe8\3\4\0,\0\0\0\0\23\0\22\0\0\3?H\xba\xdcN
    \xca\xd7@\xb8\30P%\xbb\x9f\x8b\x85\x8d\xa4\xa0q\x81\xa0\xae\xac:\x9cP\xda\xceo(\xcfl\x8d\xe2\xad\36\xf39\x98\5\xb8\xf2\r\x89\2cr\xc0l:\x990\xc8g\xba\xa9Z\xaf\xd8l5\1\0;\0";
    case 2: return
    "GIF89a\23\0\22\0\x91\2\0\0\0\0\xcc\xcc\xcc\xff\xff\xff\0\0\0!\xf9\4\1\xe8\3\2\0,\0\0\0\0\23\0\22\0\0\x024\x94\x8f\xa9\2\xed\x9b@\x98\24@#\xa9v\xefd\rV^H\6\26fr\xea\xca\x98ehI\xdf;\xc53}6\xf4\x86\xee\xf5\xe83!V\xc4\xd3\xe5\x88L*\x97\x90\2\0;\0";
    case 3: return
    "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\32\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf3\xef}[(^d9\x9dhP\0\0;\0";
    case 4: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2.\x9c\x8f\xa9\xcb\xed\xf\r\x98\x94:\20\xb2\xe\xe0j\xa1u\r\x96\x81\x99\xc8`\xc2\xbarC\x87\36d`\xba\xe3\27z\xdbyUU\4\xc\n\x87DF\1\0;\0";
    case 5: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2*\x9c\x8f\xa9\xcb\xed\xf\r\x98\x94:\20\xb2\xe\xe0n\xdd5\xd8\xc7y\xc2y\x96]\x88\x8c\37\xbb\xb8\33\xac\xc8\xe0UU\xd1\xce\xf7\xfe\xcf(\0\0;\0";
    case 6: return
    "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\33\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf9\xf0q\x94&rd\x89\x9d\xe8\xb8>\5\0;\0";
    case 7: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\x020\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\x9c\xd0\x81PGr&\xb3\t\xae\xfb\r\xca*\xa3\xa5f\xab\xb8\xa7?\xd8O\t\x86\x84\xc4a\x91R\0\0;\0";
    case 8: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2/\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\36\7B#\xa9\5\xc2\xba~\x83R&\xa7\xfb\x88c\xbc\xd8\36\x8e`>\5\xc\5\x87B\"\xa5\0\0;\0";
    case 9: return
    "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\30\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf9\xf0q\xe2H\x96\xe6\x89r\5\0;\0";
    case 10: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2/\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\x9c\xd0\x81PGr&\xb3\t\xae\xfb\r\xca*\xa3\xa5f\xab\xb8\xa7?\xd8O\t\n\x87\xc4\xa2\xb0\0\0;\0";
    case 11: return
    "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2.\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\36\7B#\xa9\5\xc2\xba~\x83R&\xa7\xfb\x88c\xbc\xd8\36\x8e`>\5\xc\n\x87\xc4`\1\0;\0";
    case 12: return
    "GIF89a\21\0\r\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2-\x9c\x81\x89\xc6\r\1\xe3j\xec\x89+\xc2\3\xf4D\x99t\26\x86i\xe2\x87r\xd4Hf\xaa\x83~o\25\xb4\x97\xb9\xc6\xd2i\xbb\xa7\x8es(\x86\xaf\2\0;\0";
    case 13: return
    "GIF89a\21\0\r\0\x91\3\0\xcc\0\0\xff\xff\xff\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2-\x9c\x81\x89\xc6\r\1\xe3j\xec\x89+\xc2\3\xf4D\x99t\26\x86i\xe2\x87r\xd4Hf\xaa\x83~o\25\xb4\x97\xb9\xc6\xd2i\xbb\xa7\x8es(\x86\xaf\2\0;\0";
    case 14: return
    "GIF89a\21\0\r\0\xa2\4\0\x99\x99\x99\xff\xff\xff\0\0\0\xcc\0\0\xff\xff\xff\0\0\0\0\0\0\0\0\0!\xf9\4\1\xe8\3\4\0,\0\0\0\0\21\0\r\0\0\x039H\n\xdc\xac0\x82@\xeb\x8bp\x8a-\xc2\4\xd8RYM8\r\3\xc5y&\x85\x8e,\x84\xces\xb0\xc5\nM\x8f
    6\5/[\xa7'\1\xa6`\xc4\xcc\x883l\xc1,&\x87\x94\x98\0\0;\0";
    case 15: return
    "GIF89a\21\0\r\0\x91\3\0\x99\x99\x99\xff\xff\xff\xcc\xcc\xcc\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2*\x9c\x8f\x99\xc0\xac\33b\4\xcf\xb4\x8b\x9d\x95\xbc\xb:\0\x81@\x96&\t\x8a\xe7\xfam\xec\x99\x8eo\31\xcf\xb4k\xb7a\x8e\36\xd9o(\0\0;\0";
    case 16: return
    "GIF89a\21\0\r\0\x91\2\0\0\0\0\xff\xff\0\xff\xff\xff\0\0\0!\xf9\4\1\xe8\3\2\0,\0\0\0\0\21\0\r\0\0\2,\x94\x8f\xa9\2\xed\xb0\xc\x8\xb3\xd25\x83\xde\32\xa6\x076_\xd5P\xa5x\x94\34\x87J\xe4vzi\7wJf\xe22\x82\xb3\21\23\xfa\t\xf\5\0;\0";
    case 0:
    default: return
    "GIF89a\23\0\22\0\x80\1\0\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\20\x8c\x8f\xa9\xcb\xed\xf\xa3\x9c\xb4\xda\x8b\xb3\xde\xbc\xd7\2\0;\0";
    }

    }
    --=====================_105323967==_
    Content-Type: image/gif; name="webadmin_folder.gif";
    x-mac-type="47494666"; x-mac-creator="4A565752"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="webadmin_folder.gif"

    R0lGODlhEQANAJEDAJmZmf///8zMzP///yH5BAHoAwMALAAAAAARAA0AAAIq
    nI+ZwKwbYgTPtIudlbwLOgCBQJYmCYrn+m3smY5vGc+0a7dhjh7ZbygAADsA

    --=====================_105323967==_
    Content-Type: image/gif; name="webadmin_smiley.gif";
    x-mac-type="47494666"; x-mac-creator="4A565752"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="webadmin_smiley.gif"

    R0lGODlhEQANAJECAAAAAP//AP///wAAACH5BAHoAwIALAAAAAARAA0AAAIs
    lI+pAu2wDAiz0jWD3hqmBzZf1VCleJQch0rkdnppB3dKZuIygrMRE/oJDwUA
    OwA=

    --=====================_105323967==_
    Content-Type: image/gif; name="webadmin_text.gif";
    x-mac-type="47494666"; x-mac-creator="4A565752"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="webadmin_text.gif"

    R0lGODlhEQANAJEDAMwAAP///5mZmf///yH5BAHoAwMALAAAAAARAA0AAAIt
    nIGJxg0B42rsiSvCA/REmXQWhmnih3LUSGaqg35vFbSXucbSabunjnMohq8C
    ADsA

    --=====================_105323967==_
    Content-Type: text/plain; charset="us-ascii"; format=flowed


    Micz Flor - micz@mi.cz

    content and media development http://mi.cz
    -----------------------------------------------------------------
    http://www.campware.org -- http://crash.mi.cz -- http://suemi.de
    "Good job. Hopefully he will go elsewhere..." (Sava Tatic)
    -----------------------------------------------------------------
    --=====================_105323967==_--

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • 1 Comment sorted by
  • Actually, embedding images in the source code is SLOWER than having the
    fetched separately due to browser image caching. We have headers for
    all the icons so that they are cached for a day. If you are seeing them
    reload with every page hit, then it is a bug (in this case, please tell
    us your browser and OS).

    - Paul


    Micz Flor wrote:
    > possibly for future admin interfaces, we should include the little icons
    > into the php source code (see below)? this function *generates* gif
    > images from ascii... yehaa. how is that for speed? (don't know
    > actually). i found this in one of my favourite one page php scripts
    > ever: webadmin. and attached three example gifs.
    >
    > the webadmin site:
    > http://cker.name/webadmin/
    >
    >
    >
    > function getImage ($iid) {
    >
    > /* escaped strings powered by bin2string.php */
    > switch ($iid) {
    > case 1: return
    > "GIF89a\23\0\22\0\xa2\4\0\0\0\0\xff\xff\xff\xcc\xcc\xcc\x99\x99\x99\xff\xff\xff\0\0\0\0\0\0\0\0\0!\xf9\4\1\xe8\3\4\0,\0\0\0\0\23\0\22\0\0\3?H\xba\xdcN
    > \xca\xd7@\xb8\30P%\xbb\x9f\x8b\x85\x8d\xa4\xa0q\x81\xa0\xae\xac:\x9cP\xda\xceo(\xcfl\x8d\xe2\xad\36\xf39\x98\5\xb8\xf2\r\x89\2cr\xc0l:\x990\xc8g\xba\xa9Z\xaf\xd8l5\1\0;\0";
    >
    > case 2: return
    > "GIF89a\23\0\22\0\x91\2\0\0\0\0\xcc\xcc\xcc\xff\xff\xff\0\0\0!\xf9\4\1\xe8\3\2\0,\0\0\0\0\23\0\22\0\0\x024\x94\x8f\xa9\2\xed\x9b@\x98\24@#\xa9v\xefd\rV^H\6\26fr\xea\xca\x98ehI\xdf;\xc53}6\xf4\x86\xee\xf5\xe83!V\xc4\xd3\xe5\x88L*\x97\x90\2\0;\0";
    >
    > case 3: return
    > "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\32\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf3\xef}[(^d9\x9dhP\0\0;\0";
    >
    > case 4: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2.\x9c\x8f\xa9\xcb\xed\xf\r\x98\x94:\20\xb2\xe\xe0j\xa1u\r\x96\x81\x99\xc8`\xc2\xbarC\x87\36d`\xba\xe3\27z\xdbyUU\4\xc\n\x87DF\1\0;\0";
    >
    > case 5: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2*\x9c\x8f\xa9\xcb\xed\xf\r\x98\x94:\20\xb2\xe\xe0n\xdd5\xd8\xc7y\xc2y\x96]\x88\x8c\37\xbb\xb8\33\xac\xc8\xe0UU\xd1\xce\xf7\xfe\xcf(\0\0;\0";
    >
    > case 6: return
    > "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\33\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf9\xf0q\x94&rd\x89\x9d\xe8\xb8>\5\0;\0";
    >
    > case 7: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\x020\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\x9c\xd0\x81PGr&\xb3\t\xae\xfb\r\xca*\xa3\xa5f\xab\xb8\xa7?\xd8O\t\x86\x84\xc4a\x91R\0\0;\0";
    >
    > case 8: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2/\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\36\7B#\xa9\5\xc2\xba~\x83R&\xa7\xfb\x88c\xbc\xd8\36\x8e`>\5\xc\5\x87B\"\xa5\0\0;\0";
    >
    > case 9: return
    > "GIF89a\23\0\22\0\x80\1\0\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\30\x8co\x80\xcb\xed\xad\x9e\x9c,\xd2+-\xdeK\xf9\xf0q\xe2H\x96\xe6\x89r\5\0;\0";
    >
    > case 10: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2/\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\x9c\xd0\x81PGr&\xb3\t\xae\xfb\r\xca*\xa3\xa5f\xab\xb8\xa7?\xd8O\t\n\x87\xc4\xa2\xb0\0\0;\0";
    >
    > case 11: return
    > "GIF89a\23\0\22\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\23\0\22\0\0\2.\x9co\x80\xcb\xed\xad\x9e\x9c\t\xd8k%\x8\xbc\x87\xe8l\36\7B#\xa9\5\xc2\xba~\x83R&\xa7\xfb\x88c\xbc\xd8\36\x8e`>\5\xc\n\x87\xc4`\1\0;\0";
    >
    > case 12: return
    > "GIF89a\21\0\r\0\x91\3\0\x99\x99\x99\xff\xff\xff\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2-\x9c\x81\x89\xc6\r\1\xe3j\xec\x89+\xc2\3\xf4D\x99t\26\x86i\xe2\x87r\xd4Hf\xaa\x83~o\25\xb4\x97\xb9\xc6\xd2i\xbb\xa7\x8es(\x86\xaf\2\0;\0";
    >
    > case 13: return
    > "GIF89a\21\0\r\0\x91\3\0\xcc\0\0\xff\xff\xff\x99\x99\x99\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2-\x9c\x81\x89\xc6\r\1\xe3j\xec\x89+\xc2\3\xf4D\x99t\26\x86i\xe2\x87r\xd4Hf\xaa\x83~o\25\xb4\x97\xb9\xc6\xd2i\xbb\xa7\x8es(\x86\xaf\2\0;\0";
    >
    > case 14: return
    > "GIF89a\21\0\r\0\xa2\4\0\x99\x99\x99\xff\xff\xff\0\0\0\xcc\0\0\xff\xff\xff\0\0\0\0\0\0\0\0\0!\xf9\4\1\xe8\3\4\0,\0\0\0\0\21\0\r\0\0\x039H\n\xdc\xac0\x82@\xeb\x8bp\x8a-\xc2\4\xd8RYM8\r\3\xc5y&\x85\x8e,\x84\xces\xb0\xc5\nM\x8f
    > 6\5/[\xa7'\1\xa6`\xc4\xcc\x883l\xc1,&\x87\x94\x98\0\0;\0";
    > case 15: return
    > "GIF89a\21\0\r\0\x91\3\0\x99\x99\x99\xff\xff\xff\xcc\xcc\xcc\xff\xff\xff!\xf9\4\1\xe8\3\3\0,\0\0\0\0\21\0\r\0\0\2*\x9c\x8f\x99\xc0\xac\33b\4\xcf\xb4\x8b\x9d\x95\xbc\xb:\0\x81@\x96&\t\x8a\xe7\xfam\xec\x99\x8eo\31\xcf\xb4k\xb7a\x8e\36\xd9o(\0\0;\0";
    >
    > case 16: return
    > "GIF89a\21\0\r\0\x91\2\0\0\0\0\xff\xff\0\xff\xff\xff\0\0\0!\xf9\4\1\xe8\3\2\0,\0\0\0\0\21\0\r\0\0\2,\x94\x8f\xa9\2\xed\xb0\xc\x8\xb3\xd25\x83\xde\32\xa6\x076_\xd5P\xa5x\x94\34\x87J\xe4vzi\7wJf\xe22\x82\xb3\21\23\xfa\t\xf\5\0;\0";
    >
    > case 0:
    > default: return
    > "GIF89a\23\0\22\0\x80\1\0\0\0\0\xff\xff\xff!\xf9\4\1\xe8\3\1\0,\0\0\0\0\23\0\22\0\0\2\20\x8c\x8f\xa9\xcb\xed\xf\xa3\x9c\xb4\xda\x8b\xb3\xde\xbc\xd7\2\0;\0";
    >
    > }
    >
    > }
    > ------------------------------------------------------------------------
    >
    >
    > ------------------------------------------------------------------------
    >
    >
    > ------------------------------------------------------------------------
    >
    >
    > Micz Flor - micz@mi.cz
    >
    > content and media development http://mi.cz
    > -----------------------------------------------------------------
    > http://www.campware.org -- http://crash.mi.cz -- http://suemi.de
    > "Good job. Hopefully he will go elsewhere..." (Sava Tatic)
    > -----------------------------------------------------------------
    >

    ------------------------------------------
    Posted to Phorum via PhorumMail