Download the PHP package truesocialmetrics/cdn without Composer
On this page you can find all versions of the php package truesocialmetrics/cdn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download truesocialmetrics/cdn
More information about truesocialmetrics/cdn
Files in truesocialmetrics/cdn
Package cdn
Short Description Cdn helper for ZF2/ZF3/Laminas
License MIT
Homepage https://github.com/truesocialmetrics/cdn
Informations about the package cdn
TweeCdn
Version 2.* Created by Rostislav Mykhajliw
Introduction
TweeCdn is a list of view helpers for support css/js/images links transformation due to rules.
Requirements
- php >= 7
- zendframework/zend-stdlib
- zendframework/zend-view
Features / Goals
- Simple by adding ?timestamp marker to the end of file e.q. /css/test.css?1234567
- Release idenitify new static files version by given REVISION number e.q. /css/1234/test.css
- Hash build unique marker based on file md5 hash e.q. /css/af34c42/test.css. It allows users to load only changed files.
- Multiple hostnames supports e.q. host1.com, host2.com
- Hash generator
Installation
Main Setup
With composer
-
Add this project and Cdn in your composer.json:
- Now tell composer to download TweeCdn by running the command:
Post installation
Enabling it in your "application.config.php" file.
Advanced configuration
- type - cdn type
- public_dir - path to public dir
- hostnames - list available hostnames
- hashes - hash list (file_path => hash)
- mapping - map specific to filepath to global CDNs: Google/NetDNA/MaxCDN
Options hostnames - support ALL cdn helpers.
-
Simple (default mode) Simple adds ?timestamp marker to the end of file Original
tranfromed to
Configuration with mapping jquery to google CDN (https://developers.google.com/speed/libraries/devguide)
-
Release Release based helper puts release number stored in file "/RELEASE" right after first folder name. As result you have unique path every release. (RELEASE file by default created by Remote multi-server automation tool - Capistrano) Original
tranfromed to
Configuration
-
Hash Hash provides almost the same to "release" but uses unique file content hash. It can works in 2 mode:
- dynamic - when hashed generates in fly
- pre-compiled - by using existed hash map For "pre-compiled" mode you can generate hash map files by using script. it creates tmp/hashes.php files list. Eventully it makes application faster because you make less IO disk by skiping files md5 calculation every request.
Original
tranfromed to
Configuration sample with fail-back protection of missed tmp/hashes.php file and hostnames. The files will be spreaded by cdn-0 and cdn-1 by random depends on filename.