PHPackages                             damianromanowski/simplecdn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. damianromanowski/simplecdn

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

damianromanowski/simplecdn
==========================

Laravel 4 simple content delivery network URL rewriter

178625[1 issues](https://github.com/damianromanowski/simplecdn/issues)PHP

Since Jan 19Pushed 10y ago3 watchersCompare

[ Source](https://github.com/damianromanowski/simplecdn)[ Packagist](https://packagist.org/packages/damianromanowski/simplecdn)[ RSS](/packages/damianromanowski-simplecdn/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Simple CDN for Laravel 4
------------------------

[](#simple-cdn-for-laravel-4)

[![Latest Stable Version](https://camo.githubusercontent.com/ecdfed1c67d21223bcef00d5443fc7d796c7a38c38205d46d9bba5e57e6d940f/68747470733a2f2f706f7365722e707567782e6f72672f64616d69616e726f6d616e6f77736b692f73696d706c6563646e2f762f737461626c652e706e67)](https://packagist.org/packages/damianromanowski/simplecdn) [![Total Downloads](https://camo.githubusercontent.com/ceaa952008695e1e8fa4550b6cf0aa2cdabb57bf1ebd4872b6c3288cb4421c5d/68747470733a2f2f706f7365722e707567782e6f72672f64616d69616e726f6d616e6f77736b692f73696d706c6563646e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/damianromanowski/simplecdn) [![Build Status](https://camo.githubusercontent.com/8cce395b85c9a0330d438fdd4b25991dcc2fed8d4199a97fd974e88b28fe33a5/68747470733a2f2f7472617669732d63692e6f72672f64616d69616e726f6d616e6f77736b692f73696d706c6563646e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/damianromanowski/simplecdn)

Simple CDN provides a simple way of re-writing your URL's for specific assets using custom defined rules. Offload your assets to a content delivery network by using an origin-pull and re-writing your URL's to point to your off-site host.

> Note that URL's will only be rewritten in your production environment!

### Installation

[](#installation)

- [Simple CDN on Packagist](https://packagist.org/packages/damianromanowski/simplecdn)
- [Simple CDN on GitHub](https://github.com/damianromanowski/simplecdn)

To get the latest version of Simple CDN simply require it in your `composer.json` file.

```
"damianromanowski/simplecdn": "dev-master"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

> Note that once Simple CDN has a stable version tagged you should use a tagged release instead of the master branch.

Once Simple CDN is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => array(

    'Damianromanowski\Simplecdn\SimplecdnServiceProvider'

)

```

### Configuration

[](#configuration)

Simple CDN provides easy configuration options for various situations. You could for example only rewrite URL's for images and video files, and even cycle between multiple hosts. Simple CDN comes with a configuration file that you can edit at your leisure.

You'll need to run `php artisan config:publish damianromanowski/simplecdn` to publish the configuration to your application.

#### Step 1: Enable the rewriter

[](#step-1-enable-the-rewriter)

This is a global setting, if this is disabled, no rules will be processed.

```
'enabled' => true,

```

#### Step 2: Set your URL

[](#step-2-set-your-url)

If you want to cycle between multiple hosts, just add them to the array.

```
'url' => array(

	'http://cdn1.example.com/',
	'http://cdn2.example.com/'

),

```

#### Step 3: Define your rules

[](#step-3-define-your-rules)

Define each group of patterns that you want, you can have one for images, css, js and video files that you can quickly enable or disable at any time. The url parameter works just like the global url option, specify multiple to cycle between hosts.

```
'rules' => array(

	array(
	    'url'       => array('http://images.example.com/'),
		'pattern'	=> 'png|tif|tiff|gif|jpeg|jpg|jif|jfif|jp2|jpx|j2k|j2c|ico',
		'enabled'	=> true
	),

	array(
		'pattern'	=> 'css',
		'enabled'	=> false
	),

	array(
		'pattern'	=> 'js',
		'enabled'	=> false
	),

	array(
	    'url'       => array('http://video1.example.com/', 'http://video2.example.com/'),
		'pattern'	=> 'asf|avi|flv|m1v|m2v|m4v|mkv|mpeg|mpg|mpe|ogg|rm|wmv|mp4|webm',
		'enabled'	=> true
	)

),

```

And you're all done!

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c72e39b9dfceba8d839c7b622c22c79bd6536e62b87e65d6039e53e16ea4771?d=identicon)[damianromanowski](/maintainers/damianromanowski)

---

Top Contributors

[![damianromanowski](https://avatars.githubusercontent.com/u/5643675?v=4)](https://github.com/damianromanowski "damianromanowski (19 commits)")[![ningsuhen](https://avatars.githubusercontent.com/u/6159372?v=4)](https://github.com/ningsuhen "ningsuhen (5 commits)")

### Embed Badge

![Health badge](/badges/damianromanowski-simplecdn/health.svg)

```
[![Health](https://phpackages.com/badges/damianromanowski-simplecdn/health.svg)](https://phpackages.com/packages/damianromanowski-simplecdn)
```

###  Alternatives

[kozz/emoji-regex

Emoji regex parser

31171.2k](/packages/kozz-emoji-regex)[byte5/laravel-passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

8821.3k](/packages/byte5-laravel-passgenerator)[soyhuce/next-ide-helper

Laravel ide helper rebuilt under steroids

4756.2k3](/packages/soyhuce-next-ide-helper)[usu/codice-fiscale

A library to calculate and check the validity of the italian fiscal code (codice fiscale)

23170.9k1](/packages/usu-codice-fiscale)[kzykhys/steganography

Simple implementation of Steganography (Hiding a hidden message within an image)

889.7k](/packages/kzykhys-steganography)[jxlwqq/watermark

generate text watermark with canvas

1014.8k](/packages/jxlwqq-watermark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
