PHPackages                             bcairns/silverstripe-assetproxy - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. bcairns/silverstripe-assetproxy

ActiveSilverstripe-module[File &amp; Storage](/categories/file-storage)

bcairns/silverstripe-assetproxy
===============================

Attempts to fetch missing asset files from a remote host, by intercepting 404 errors.

1862[1 issues](https://github.com/bcairns/silverstripe-assetproxy/issues)PHP

Since Nov 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bcairns/silverstripe-assetproxy)[ Packagist](https://packagist.org/packages/bcairns/silverstripe-assetproxy)[ RSS](/packages/bcairns-silverstripe-assetproxy/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe Asset Proxy
========================

[](#silverstripe-asset-proxy)

Description
-----------

[](#description)

Attempts to fetch missing asset files from a remote host, by intercepting 404 errors. The idea is to download missing asset files from staging/production sites on-demand, without needing to do full syncs of the assets folder.

Unfortunately, out-of-the-box this will NOT WORK with SilverStripe's default image handling, because these don't generate image tags / URLs (needed to trigger 404s) if the images don't exist locally. There are two methods for getting images to work, see Methods under Usage.

There is a similar issue with File objects; the template expression `` will return false if the file does not exist locally, so it is suggested to use something like `` instead, to test if a file link should be displayed.

Usage
-----

[](#usage)

After installing the module, define an `ASSETPROXY_SOURCE` constant in either \_config.php or \_ss\_environment.php:

```
define('ASSETPROXY_SOURCE','http://my-source-server.com');

```

### Method 1 - Automatic Image Handling

[](#method-1---automatic-image-handling)

For automatic image handling, the core `Image` and `Image_Cached` classes need to be replaced with AssetProxy's extended versions:

```
Injector:
  Image:
    class: AssetProxy_Image
  Image_Cached:
    class: AssetProxy_Image_Cached

```

This overrides the methods necessary to make AssetProxy work automatically (unfortunately this is not possible via Extensions).

### Method 2 - Use Image Profiles module

[](#method-2---use-image-profiles-module)

Instead of replacing the core `Image` classes (which may conflict with certain setups) you can use this module in conjunction with [Image Profiles](https://github.com/bcairns/silverstripe-imageprofiles), and template code like `$Image.Original` or `$Image.ProfileName`, which will always output an image tag and subsequently trigger the download via 404 handling.

This method is highly recommended as it has other benefits, such as not handling image manipulation on the main page request (which can cause delays in page load time). However it does require a modified approach to how you deal with images in templates.

Suggested Modules
-----------------

[](#suggested-modules)

- [Image Profiles](https://github.com/bcairns/silverstripe-imageprofiles) - A "non-blocking" approach to image handling, using configurable profiles. If you want to use Method 2 above, this module is a requirement.
- [Backup/Restore](https://github.com/bcairns/silverstripe-backuprestore) - Super simple downloading/uploading MySQL DB dump files from within the CMS.

Using these three modules together makes for environment-sync heaven! Effortlessly sync the database from production (or staging), and any missing images &amp; files will automagically show up on-demand.

Known Issues
------------

[](#known-issues)

- If the source image is changed (while retaining an identical filename) the new version will not replace the old one. Suggested workaround is to just delete your local version of the file and let the latest be re-fetched.

Acknowledgements
----------------

[](#acknowledgements)

- This module is inspired by Drupal's [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) module.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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://avatars.githubusercontent.com/u/638372?v=4)[Brian Cairns](/maintainers/bcairns)[@bcairns](https://github.com/bcairns)

### Embed Badge

![Health badge](/badges/bcairns-silverstripe-assetproxy/health.svg)

```
[![Health](https://phpackages.com/badges/bcairns-silverstripe-assetproxy/health.svg)](https://phpackages.com/packages/bcairns-silverstripe-assetproxy)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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