.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================================== EXT: Readable name of your extension ==================================== :Created: 2010-02-18T17:33:18 :Changed by: Fernando :Changed: 2010-02-24T17:53:42 :Classification: extensionkey :Description: The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ---- :Keywords: keywords comma-separated :Author: Author Name :Email: your@email.com :Info 4: :Language: en |img-1| |img-2| EXT: Readable name of your extension - extensionkey .. _EXT-Replace-local-files-with-CDN-files: EXT: Replace local files with CDN files ======================================= Extension Key: cdnfiles Language: en Keywords: cdn,replace,frontend,files Copyright 2000-2010, Fernando Arconada, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: Replace local files with CDN files 1 <#1.EXT:%20Replace%20local%20files%20with%20CDN%20files|outline>`_ **`Introduction 3 <#1.1.Introduction|outline>`_** `What does it do? 3 <#1.1.1.What%20does%20it%20do_|outline>`_ `Screenshots 3 <#1.1.2.Screenshots|outline>`_ **`Users manual 5 <#1.2.Users%20manual|outline>`_** `FAQ 5 <#1.2.1.FAQ|outline>`_ **`Administration 6 <#1.3.Administration|outline>`_** `FAQ 6 <#1.3.1.FAQ|outline>`_ **`Configuration 7 <#1.4.Configuration|outline>`_** `FAQ 7 <#1.4.1.FAQ|outline>`_ **`Known problems 8 <#1.5.Known%20problems|outline>`_** **`To-Do list 9 <#1.6.To-Do%20list|outline>`_** **`ChangeLog 10 <#1.7.ChangeLog|outline>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension replaces local file references in the html page with references to remote files. With this change you could easy scale your web application so you could distribute the charge of downloading resources from your server and you could serve them from a Content Delivery Network like Amazon CloudWatch. This extension mostly, it is a hook that reads the html before send it to the user and then replaces the file strings, this extension doesnt upload the content to any kind of server cause i think that this should be an architectural task that you could solve with a scheduled task (rsync or similar) or mounting the remote filesystem as it is a local one. .. _Screenshots: Screenshots ^^^^^^^^^^^ Just install, configure and go. .. _img-3-Users-manual: |img-3| Users manual -------------------- - Install the extension from TER or TYPO3 forge - Configure the extension: - Clean the cache - Ready .. _Configuration: Configuration ------------- - The configuration is splited in 3 parts, one for each TYPO3 files directory related with FE: fileadmin/ uploads/ and typo3temp/pics/ - Each part of the configuration has the following parameters (this explanation it is for fileadmin): - replace\_fileadmin\_directory: should I replace file references for files in fileadmin/ directory? - fileadmin\_regexp: to match the fileadmin/ directory a regular expression it is used and evaluated case insensitive. You could use regular expression variables using () then $1 is used instead of the whole match. The regular expression, internally, adds quotes to your expression to locate only quoted file references - fileadmin\_urlprefix: an URL in the CDN should have the form [prefix in the CDN] + [same path as in you local server] i.e. `http://mybucket.s3.amazon.com/fileadmin/mydir/myphoto.jpg `_ - remove\_fileadmin\_directory: in many cases you will want to remove file fileadmin/ directory cause it is the document root of your CDN server. - advancedconfig\_file: this parameter is common for all directories and should be located under site path and written in YAML format. `http://components.symfony-project.org/yaml/trunk/book/02-YAML `_ The configuration section has 2 sections files and patterns. files section has priority over patterns section. With this configuration file you could add exceptions to the global replacement policy. Example of the file: *## YAML CDN configuration file* *patterns:* *#any valid regular expression in PCRE format* *'(fileadmin/[^"]\*\.css)':* *# prefix to apply if i found this regular expression* *#it isnt necesary if replace: false* *cdn\_prefix: " `http://a0.twimg.com/a/1266605807/images/ `_ "* *#if i founf that regular expression, should i replace the file or leave as it is.* *replace: false* *files:* *#could be a exact file or a regular expression in PCRE format* *"jquery-1.3.2.min.js":* *#it isnt necesary if replace: false* *# by default replace is always false* *replace: true* *#In the files section i dont use the pattern [CDN prefix]+[file path]* *#I just replace all the file reference with the string in cdn\_url* *cdn\_url: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js* *"typo3temp/pics/3a5338c306.jpg":* *replace: false* .. _FAQ: FAQ ^^^ Possible subsections: FAQ .. _Known-problems: Known problems -------------- The extension could find file references inside regular text .. _To-Do-list: To-Do list ---------- - Don't do any replacement if some content in the page where updated less than X seconds agoç - Verify that the file reference is found inside a HTML tag not only in a quoted string .. _ChangeLog: ChangeLog --------- 24-02-2001 First upload 9 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 965 .. :name: gráficos1 .. :width: 572