[Frage] Scriptmerger Komprimierung arbeitet nicht - Typo 3 6.2 TYPO3-Version: 6.2.7

  • 0 x
    25 Beiträge
    0 Hilfreiche Beiträge
    15. 03. 2016, 22:42

    Hallo,

    ich habe mehrere Installationen:

    Typo3 6.2.
    Auf der einen läuft Scriptmerger und tut was es soll:
    Fast Dateien zusammen und komprimiert sie nach GZIP :)

    HTACCESS:

    1. #####
    2. #
    3. # Example .htaccess file for TYPO3 CMS - for use with Apache Webserver
    4. #
    5. # This file includes settings for the following configuration options:
    6. #
    7. # - Compression via TYPO3
    8. # - Settings for mod_rewrite (URL-Rewriting)
    9. # - PHP optimisation
    10. # - Miscellaneous
    11. #
    12. # If you want to use it, you have to copy it to the root folder of your TYPO3 installation (if its
    13. # not there already) and rename it to '.htaccess'. To make .htaccess files work, you might need to
    14. # adjust the 'AllowOverride' directive in your Apache configuration file.
    15. #
    16. # IMPORTANT: You may need to change this file depending on your TYPO3 installation!
    17. #
    18. # Lines starting with a # are treated as comment and ignored by the web server.
    19. #
    20. # You should change every occurance of TYPO3root/ to the location where you have your website in.
    21. # For example:
    22. # If you have your website located at http://mysite.com/
    23. # then your TYPO3root/ is just empty (remove 'TYPO3root/')
    24. # If you have your website located at http://mysite.com/some/path/
    25. # then your TYPO3root/ is some/path/ (search and replace)
    26. #
    27. # You can also use this configuration in your httpd.conf, but then you have to modify some lines,
    28. # see the comments (search for 'httpd.conf')
    29. #
    30. # Questions about this file go to the matching Install mailing list, see
    31. # http://typo3.org/documentation/mailing-lists/
    32. #
    33. ####
    34.  
    35.  
    36. ### Begin: Compression via TYPO3 ###
    37.  
    38. # Compressing resource files will save bandwidth and so improve loading speed especially for users
    39. # with slower internet connections. TYPO3 can compress the .js and .css files for you.
    40. # *) Uncomment the following lines and
    41. # *) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '9' for the Backend
    42. # *) Set $TYPO3_CONF_VARS['FE']['compressionLevel'] = '9' together with the TypoScript properties
    43. # config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
    44.  
    45. #<FilesMatch "\.js\.gzip$">
    46. # AddType "text/javascript" .gzip
    47. #</FilesMatch>
    48. #<FilesMatch "\.css\.gzip$">
    49. # AddType "text/css" .gzip
    50. #</FilesMatch>
    51. #AddEncoding gzip .gzip
    52.  
    53. ### End: Compression via TYPO3 ###
    54.  
    55.  
    56. ### Begin: Browser caching of ressource files ###
    57.  
    58. # Enable long browser caching for JavaScript and CSS files.
    59.  
    60. # This affects Frontend and Backend and increases performance.
    61. # You can also add other file extensions (like gif, png, jpg), if you want them to be longer cached, too.
    62.  
    63. <FilesMatch "\.(js|css)$">
    64. <IfModule mod_expires.c>
    65. ExpiresActive on
    66. ExpiresDefault "access plus 7 days"
    67. </IfModule>
    68. FileETag MTime Size
    69. </FilesMatch>
    70.  
    71. ### End: Browser caching of ressource files ###
    72.  
    73.  
    74. ### Begin: Settings for mod_rewrite ###
    75.  
    76. # You need rewriting, if you use a URL-Rewriting extension (RealURL, CoolUri).
    77.  
    78. <IfModule mod_rewrite.c>
    79.  
    80. # Enable URL rewriting
    81. RewriteEngine On
    82.  
    83. # Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
    84. #RewriteBase /
    85.  
    86. # Rules to set ApplicationContext based on hostname
    87. #RewriteCond %{HTTP_HOST} ^dev\.example\.com$
    88. #RewriteRule .? - [E=TYPO3_CONTEXT:Development]
    89. #RewriteCond %{HTTP_HOST} ^staging\.example\.com$
    90. #RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging]
    91. #RewriteCond %{HTTP_HOST} ^www\.example\.com$
    92. #RewriteRule .? - [E=TYPO3_CONTEXT:Production]
    93.  
    94. # Rule for versioned static files, configured through:
    95. # - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
    96. # - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
    97. # IMPORTANT: This rule has to be the very first RewriteCond in order to work!
    98. RewriteCond %{REQUEST_FILENAME} !-f
    99. RewriteCond %{REQUEST_FILENAME} !-d
    100. RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
    101.  
    102. # Basic security checks
    103. # - Restrict access to deleted files in Recycler directories
    104. # - Restrict access to TypoScript files in default templates directories
    105. # - Restrict access to Private extension directories
    106. # For httpd.conf, use these lines instead of the next ones:
    107. # RewriteRule ^/TYPO3root/fileadmin/(.*/)?_recycler_/ - [F]
    108. # RewriteRule ^/TYPO3root/fileadmin/templates/.*(\.txt|\.ts)$ - [F]
    109. # RewriteRule ^/TYPO3root/typo3conf/ext/[^/]+/Configuration/ - [F]
    110. # RewriteRule ^/TYPO3root/typo3conf/ext/[^/]+/Resources/Private/ - [F]
    111. RewriteRule ^fileadmin/(.*/)?_recycler_/ - [F]
    112. RewriteRule ^fileadmin/templates/.*(\.txt|\.ts)$ - [F]
    113. RewriteRule ^typo3conf/ext/[^/]+/Configuration/ - [F]
    114. RewriteRule ^typo3conf/ext/[^/]+/Resources/Private/ - [F]
    115.  
    116. # Stop rewrite processing, if we are in the typo3/ directory.
    117. # For httpd.conf, use this line instead of the next one:
    118. # RewriteRule ^/TYPO3root/(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
    119. RewriteRule ^(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
    120.  
    121. # If the file/symlink/directory does not exist => Redirect to index.php.
    122. # For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
    123. RewriteCond %{REQUEST_FILENAME} !-f
    124. RewriteCond %{REQUEST_FILENAME} !-d
    125. RewriteCond %{REQUEST_FILENAME} !-l
    126.  
    127. # Main URL rewriting.
    128. # For httpd.conf, use this line instead of the next one:
    129. # RewriteRule .* /TYPO3root/index.php [L]
    130. RewriteRule .* index.php [L]
    131.  
    132. </IfModule>
    133.  
    134. ### End: Settings for mod_rewrite ###
    135.  
    136.  
    137. ### Begin: PHP optimisation ###
    138.  
    139. # If you do not change the following settings, the default values will be used.
    140.  
    141. # TYPO3 works fine with register_globals turned off.
    142. # This is highly recommended, if your web server has it turned on.
    143. #php_flag register_globals off
    144.  
    145. ### End: PHP optimisation ###
    146.  
    147.  
    148.  
    149. ### Begin: Miscellaneous ###
    150.  
    151. # Make sure that directory listings are disabled.
    152. #Options -Indexes
    153.  
    154. ### End: Miscellaneous ###
    155.  
    156.  
    157. # Add your OWN RULES HERE (! ! ! !).
    158. # ...
    159. ##### Einstellungen für realurl #####
    160. RewriteEngine On
    161. RewriteBase /
    162. RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L]
    163. RewriteRule ^typo3$ typo3/index_re.php [L]
    164. RewriteCond %{REQUEST_FILENAME} !-f
    165. RewriteCond %{REQUEST_FILENAME} !-d
    166. RewriteCond %{REQUEST_FILENAME} !-l
    167. #RewriteRule .* /index.php [L]
    168. #RewriteCond %{REQUEST_FILENAME} !-f
    169. #RewriteCond %{REQUEST_FILENAME} !-l
    170. RewriteCond %{REQUEST_FILENAME} (^.htm$|^.html$)
    171. RewriteRule (.*[^/])$ %{HTTP_HOST}/$1/ [L,R]
    172.  
    173.  
    174.  
    175. ##### Umleitung von https zu http: #####
    176. RewriteCond %{SERVER_PORT} !^80$
    177. RewriteRule (.*) http://%{HTTP_HOST}/$1 [L]
    178.  
    179.  
    180.  
    181. #### Umleitung www.Domain: ####
    182. RewriteEngine on
    183. RewriteCond %{HTTP_HOST} ^DOMAIN1\.de$ [NC]
    184. RewriteRule ^(.*)$ http://www.DOMAIN1.de/$1 [R=301,L]
    185.  
    186. RewriteEngine on
    187. RewriteCond %{HTTP_HOST} ^DOMAIN2\.de$ [NC]
    188. RewriteRule ^(.*)$ http://www.DOMAIN2.de/$1 [R=301,L]
    189.  
    190. #### Umleitung www.Domain: ####
    191. #RewriteEngine on
    192. #Options +FollowSymlinks
    193. #RewriteEngine on
    194. #RewriteRule ^showresults.php(.*)$ http://www.DOMAIN1.de/showresults.php$1 [r=301,nc]
    195.  
    196.  
    197. ##### Scriptmerger Settings: Expires Header + Removal of ETag #####
    198. <FilesMatch "\.(ico|png|gif|js|css|jpg|jpeg|swf)">
    199. <IfModule mod_expires.c>
    200. ExpiresActive on
    201. ExpiresDefault "access plus 2 months"
    202. </IfModule>
    203.  
    204. # ETag
    205. FileETag MTime Size
    206. <IfModule mod_headers.c>
    207. FileETag none
    208. Header unset Last-Modified
    209. </IfModule>
    210. </FilesMatch>
    211.  
    212. # Compressed Content
    213. <FilesMatch "\.gz\.(js|css)">
    214. <IfModule mod_headers.c>
    215. Header set Content-Encoding gzip
    216. </IfModule>
    217. </FilesMatch>
    218.  
    219. ##### GZIP Kompriemierung: #####
    220. ### Begin: Compression via TYPO3 ###
    221. # Compressing resource files will save bandwidth and so improve loading speed especially for users# with slower internet connections. TYPO3 can compress the .js and .css files for you.# *) Uncomment the following lines and# *) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '5' for the Backend# *) Set $TYPO3_CONF_VARS['FE']['compressionLevel'] = '5' together with the TypoScript properties# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
    222. AddType "text/javascript" .gzip AddType "text/css" .gzipAddEncoding gzip .gzip
    223. AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-shockwave-flash
    224.  
    225. ### End: Compression via TYPO3 ###
    226.  
    227. ### Begin: Browser caching of ressource files ###
    228. # Enable long browser caching for JavaScript and CSS files.
    229. # This affects Frontend and Backend and increases performance.# You can also add other file extensions (like gif, png, jpg), if you want them to be longer cached, too.
    230. ExpiresActive on ExpiresDefault "access plus 7 days" FileETag MTime Size
    231. ### End: Browser caching of ressource files ###

    SETUP-Code für die Aktivierung:

    1. #Scriptmerger: Dateien zusammenfassen.
    2. # JS Body Dateien Zusammenfassen:
    3. plugin.tx_scriptmerger.javascript.parseBody = 1
    4. # CSS Dateien zusammenfassen
    5. plugin.tx_scriptmerger {
    6. css {
    7. minify {
    8. enable = 1
    9. ignore = \.min\.
    10. }
    11. compress {
    12. enable = 1
    13. ignore = \.gz\.
    14. }
    15. merge {
    16. enable = 1
    17. ignore =
    18. }
    19. }
    20. javascript {
    21. minify {
    22. enable = 1
    23. ignore = \?,\.min\.
    24. }
    25. compress {
    26. enable = 1
    27. ignore = \?,\.gz\.
    28. }
    29. merge {
    30. enable = 1
    31. ignore = \?
    32. }
    33. }
    34. }

    Obgleich ich in All Configuration die Compressionswerte auf 0 stehen läuft es.
    Dieselbe Konfiguration habe ich nun auf eine zweite und dritte Seite übertragen angelegt und Kopiert.
    Auf das Template für den Scriptmerger wurde eingebunden.

    Ergebnis, die Dateien werden zusammengefasst, jedoch erfolgt keine GZIP Komprimierung auf der zweiten und dritten Seite.

    Habe bereits folgendes probiert:
    - Andere Extension Templates rausgenommen oder hinzugefügt.
    - Andere htaccess verwendet auch das Original aus der Extension.
    - Auch mit diesen Einstellungen habe ich es probiert:

    1. config.no_cache = 0
    2. config.compressJs = 1
    3. config.compressCss = 1
    4. config.concatenateJs = 1
    5. config.concatenateCss = 1

    - Auch habe ich einfach Code aus meiner Setup.TS massig entfernt um zu testen.
    - Alle Extension aktualisiert

    Es bleibt aber immer gleich auf der 1 Typo 3 6.2 läuft die Kompriemierung auf den anderen beiden nicht.

    Hat noch jemand eine Idee oder eine Alternative?
    Vielen Dank im Voraus.
    Auch


  • 1
  • 0 x
    25 Beiträge
    0 Hilfreiche Beiträge
    17. 03. 2016, 17:31

    Eine Klärung brachte nun am Ende mein Provider (Domainfactory) die einen erstklassigen Service haben, vielen Dank!

    Der Scriptmerger arbeitet wie die GZIP Komprimierung korrekt.
    Das Tool, mit dem ich die GZIP Komprimierung geprüft habe, hat jedoch die Komprimierung nicht erkannt, da ich vom Startbaum der Typo3 Installation einen Redirect auf die Home-Seite hatte.

    Nachdem entfernen des Redirect wurde es dann richtig angezeigt.

  • 1