Download the PHP package moderntribe/tribe-storage-statically-cdn without Composer
On this page you can find all versions of the php package moderntribe/tribe-storage-statically-cdn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moderntribe/tribe-storage-statically-cdn
More information about moderntribe/tribe-storage-statically-cdn
Files in moderntribe/tribe-storage-statically-cdn
Package tribe-storage-statically-cdn
Short Description Tribe Storage Plugin to add statically.io CDN support
License
Informations about the package tribe-storage-statically-cdn
Tribe Storage Plugin: Statically.io
Provides dynamic image sizing and optimization via statically.io and only creates WordPress thumbnails for images that require hard cropping.
Installation Composer v1
Add the following to the composer.json repositories
object:
Then run:
Configuration
There are two ways to configure this plugin, either directly using the cdn.statically.io
directly, or proxying
to that domain via Nginx.
Use statically.io URLs directly
Ensure you have defined the TRIBE_STORAGE_URL
constant in wp-config.php
to your cloud provider's publicly
accessible URL and it will be replaced to use Statically's CDN for images only:
NOTE: Image URLs are cached, ensure your flush your object cache if you make any changes to the following defines.
URL rewriting would look as follows:
- Original:
https://account.blob.core.windows.net/container/sites/4/2021/06/image.jpg
- Rewritten:
https://cdn.statically.io/img/account.blob.core.windows.net/f=auto,w=1024,h=1024/container/sites/4/2021/06/image.jpg
Use statically.io as a proxy via Nginx
Ensure you do not have TRIBE_STORAGE_URL
defined, and define the following in wp-config.php
:
Sample Nginx Proxy
Replace
account.blob.core.windows.net
below with your cloud provider's hostname. Using the example from above it would be:account.blob.core.windows.net/container
URL rewriting would look as follows, and proxied to Statically behind the scenes:
- Original:
https://example.com/wp-content/uploads/sites/4/2021/06/image.jpg
- Rewritten:
https://example.com/wp-content/uploads/f=auto,w=1024,h=1024/sites/4/2021/06/image.jpg
- Proxied URL:
https://cdn.statically.io/img/account.blob.core.windows.net/f=auto,w=1024,h=1024/container/sites/4/2021/06/image.jpg
Disable WordPress thumbnail creation
If you're not concerned with exact cropping, you can let statically.io resize your image based with keeping the same dimension ratio and disable thumbnail creation to see a large performance boost when uploading new images.
For this you have two options:
Option 1: Add this define to wp-config.php
Option 2: Make the tribe/storage/plugin/statically/create_thumbnails
filter return false, e.g.
NOTE: Don't forget to clear object caching and regenerate thumbnails each time this option is swapped.
Automated Testing
Testing provided via PHPUnit and the Brain Monkey testing suite.
Run Unit Tests
More Resources:
All versions of tribe-storage-statically-cdn with dependencies
ext-json Version *
php-di/php-di Version ^6.0
moderntribe/tribe-storage Version ^3.0