\CDNRewriteRequestFilter
Synopsis
class CDNRewriteRequestFilter
implements
RequestFilter
{
- // members
- private static bool $cdn_rewrite = false;
- private static string $cdn_domain = 'http://cdn.mysite.com';
- private static bool $enable_in_backend = false;
- private static bool $enable_in_dev = false;
- private static bool $rewrite_assets = true;
- private static bool $rewrite_themes = false;
- // methods
- public boolean preRequest()
- public boolean postRequest()
- public static bool isEnabled()
- public static bool isBackend()
- public static mixed|void replaceCDN()
Hierarchy
Implements
- RequestFilter
Members
private
- $cdn_domain
—
string
The cdn domain incl. protocol - $cdn_rewrite
—
bool
Enable rewriting of asset urls - $enable_in_backend
—
bool
Enable rewrite in admin area - $enable_in_dev
—
bool
Enable rewrite in dev mode - $rewrite_assets
—
bool
should assets be rewritten? - $rewrite_themes
—
bool
should themes also be rewritten?
Methods
public
- isBackend() — Helper method to check if we're in backend (LeftAndMain) or frontend Controller::curr() doesn't return anything, so i cannot check it...
- isEnabled() — Checks if cdn rewrite is enabled
- postRequest() — Filter executed AFTER a request
- preRequest() — Filter executed before a request processes
- replaceCDN() — replaces links to assets in src and href attributes to point to a given cdn domain