![]() |
Indy HTTPServer - Komprimierung möglich?
hi
ich versuche gerade über den indy HTTPServer einige automatisch generiete Seiten anzuzeigen. Es es möglich, eine Art Kompression (ala gzip o.ä.) mit zu integrieren oder zu aktivieren? danke euch crypti |
Re: Indy HTTPServer - Komprimierung möglich?
willst du eine komprimierte Datei dem Browser zurück liefern oder die Seiten komprimiert übertragen? Unterstützen das die Browser überhaupt das der Server komprimierte Seiten zurück liefert???
|
Re: Indy HTTPServer - Komprimierung möglich?
ich will die seite komprimiert übertragen lassen. So wie man das auch beim "richtigen" Webserver machen kann.
|
Re: Indy HTTPServer - Komprimierung möglich?
nach meinem Kenntnisstand wird das von den Indies nicht direkt unterstützt. allerdings könntest du dich informieren wie das ganze protokolmäßig von statten geht und dann die comprimierung selbst durchführen und per Header dem Browser das auch mitteilen das die Datei komprimiert übertragen wurde (fall das überhaupt sache des browsers ist was ich bezweifel)
|
Re: Indy HTTPServer - Komprimierung möglich?
Zitat:
Zitat:
Grüße vom marabu |
Re: Indy HTTPServer - Komprimierung möglich?
hmm, die komponenten kenne ich nicht, also wird es wohl doch unterstützt -> Indyhilfe dazu lesen
|
Re: Indy HTTPServer - Komprimierung möglich?
Die Online-Hilfe habe ich gerade gefressen - und bin zu dem vorläufigen Schluss gekommen, dass dein Kenntnisstand vielleicht gar nicht so verkehrt ist. Die Intercept-Komponente hat zwei Events - OnReceive() und OnSend() - die erhalten einen Stream als Parameter. Ich vermute, dass die Intercept-Komponente nur den Zugang zum Download-(Upload-)Stream offen legt, wundere mich aber, warum sie Compress im Namen trägt...
marabu |
Re: Indy HTTPServer - Komprimierung möglich?
Zitat:
|
Re: Indy HTTPServer - Komprimierung möglich?
Das war meine ursprüngliche Interpretation, aber Genaueres erfahren wir nur wenn es jemand ausprobiert...
marabu |
Re: Indy HTTPServer - Komprimierung möglich?
Laut Hilfe komprimiert diese Komponente auch. Über das property CompressionLevel kann man dies einstellen. Hilfe Seite:
Code:
Implements an intercept that compresses a data stream using zlib.
TIdCompressionIntercept = class(TIdConnectionIntercept) Description TIdCompressionIntercept is a TIdConnectionIntercept descendant that implements an Indy intercept component that compresses a data stream using the open-source zlib compression library. Set the CompressionLevel property to a value between 1 and 9 to enable compressing of the data stream. A setting of 0(zero) disables compression and the component is dormant. The sender *and* received must have compression enabled in order to properly decompress the data stream. They do *not* have to use the same CompressionLevel as long as they are both set to a value between 1 and 9. In order for this file to compile on Windows, the follow .obj files *must* be provided as delivered with this file: deflate.obj inflate.obj inftrees.obj trees.obj adler32.obj infblock.obj infcodes.obj infutil.obj inffast.obj On Linux, the shared-object file libz.so.1 *must* be available on the system. Most modern Linux distributions include this file. You may sometimes get the following compiler errors with this file: IdCompressionIntercept.pas(331) Error: Incompatible types IdCompressionIntercept.pas(152) Error: Unsatisfied forward or external declaration: '_tr_init' IdCompressionIntercept.pas(153) Error: Unsatisfied forward or external declaration: '_tr_tally' IdCompressionIntercept.pas(154) Error: Unsatisfied forward or external declaration: '_tr_flush_block' IdCompressionIntercept.pas(155) Error: Unsatisfied forward or external declaration: '_tr_align' IdCompressionIntercept.pas(156) Error: Unsatisfied forward or external declaration: '_tr_stored_block' IdCompressionIntercept.pas(157) Error: Unsatisfied forward or external declaration: 'adler32' IdCompressionIntercept.pas(158) Error: Unsatisfied forward or external declaration: 'inflate_blocks_new' IdCompressionIntercept.pas(159) Error: Unsatisfied forward or external declaration: 'inflate_blocks' IdCompressionIntercept.pas(160) Error: Unsatisfied forward or external declaration: 'inflate_blocks_reset' IdCompressionIntercept.pas(161) Error: Unsatisfied forward or external declaration: 'inflate_blocks_free' IdCompressionIntercept.pas(162) Error: Unsatisfied forward or external declaration: 'inflate_set_dictionary' IdCompressionIntercept.pas(163) Error: Unsatisfied forward or external declaration: 'inflate_trees_bits' IdCompressionIntercept.pas(164) Error: Unsatisfied forward or external declaration: 'inflate_trees_dynamic' IdCompressionIntercept.pas(165) Error: Unsatisfied forward or external declaration: 'inflate_trees_fixed' IdCompressionIntercept.pas(166) Error: Unsatisfied forward or external declaration: 'inflate_trees_free' IdCompressionIntercept.pas(167) Error: Unsatisfied forward or external declaration: 'inflate_codes_new' IdCompressionIntercept.pas(168) Error: Unsatisfied forward or external declaration: 'inflate_codes' IdCompressionIntercept.pas(169) Error: Unsatisfied forward or external declaration: 'inflate_codes_free' IdCompressionIntercept.pas(170) Error: Unsatisfied forward or external declaration: '_inflate_mask' IdCompressionIntercept.pas(171) Error: Unsatisfied forward or external declaration: 'inflate_flush' IdCompressionIntercept.pas(172) Error: Unsatisfied forward or external declaration: 'inflate_fast' IdCompressionIntercept.pas(189) Error: Unsatisfied forward or external declaration: 'deflateInit_' IdCompressionIntercept.pas(196) Error: Unsatisfied forward or external declaration: 'deflate' IdCompressionIntercept.pas(203) Error: Unsatisfied forward or external declaration: 'deflateEnd' IdCompressionIntercept.pas(213) Error: Unsatisfied forward or external declaration: 'inflateInit_' IdCompressionIntercept.pas(220) Error: Unsatisfied forward or external declaration: 'inflate' IdCompressionIntercept.pas(227) Error: Unsatisfied forward or external declaration: 'inflateEnd' IdCompressionIntercept.pas(234) Error: Unsatisfied forward or external declaration: 'inflateReset' Indy40.dpk(196) Fatal: Could not compile used unit 'IdCompressionIntercept.pas' Do not be alarmed. This is due to a bug in DCC32 in Delphi 4, 5, 6, plus C++Builder, 4, 5, and 6. There is a workaround for this issue. The workaround is to compile this unit separately from the other units and than build Indy with a command such as DCC32 using the /M parameter. DO not use the /B parameter as that does force everything to be recompiled triggering the DCC32 error. The batch files FULLC4.BAT, FULLC5.BAT, FULLC6.BAT, FULLD4.BAT, FULLD5.BAT and FULLD6.BAT now have the workaround in them so we recommend that you use those to build Indy. Borland is aware of the issue. Original Author: Allen Bauer This source file is submitted to the Indy project on behalf of Borland Sofware Corporation. No warranties, express or implied are given with this source file. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:07 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz