TYPO3 cdn pull support

From snippet wiki
Jump to navigation Jump to search

The most simple way to speed up a website is using a cdn.

You don't need to care about synchronizing the cdn storage when using a cdn pull architecure. Just rewrite any local or relative link to resources like images to an absolute cdn url, that server will then first fetch your object once and deliver it by itself for the next time.

temp.cdnpull {
  10 {
    search = #/?fileadmin/#
    useRegExp = 1
    replace = http://cdn.example.com/fileadmin/
  }
}

page.stdWrap.replacement < temp.cdnpull

If you need more than one search/replace pattern, the arguments to page.stdWrap.replacement are an array, so this should work too:

temp.cdnpull {
  10 {
    search = #/?fileadmin/#
    useRegExp = 1
    replace = http://cdn.example.com/fileadmin/
  }
  20 {
    search = #/?uploads/#
    useRegExp = 1
    replace = http://cdn.example.com/uploads/
  }
}

page.stdWrap.replacement < temp.cdnpull