Download the PHP package bootpress/asset without Composer
On this page you can find all versions of the php package bootpress/asset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download bootpress/asset
More information about bootpress/asset
Files in bootpress/asset
Download bootpress/asset
More information about bootpress/asset
Files in bootpress/asset
Vendor bootpress
Package asset
Short Description Caches and delivers assets of every sort, from any location, with hands-off versioning. Manipulates images on-the-fly. Minifies and combines (on-demand) css and javascript files.
License MIT
Homepage https://www.bootpress.org/components/asset.html
Package asset
Short Description Caches and delivers assets of every sort, from any location, with hands-off versioning. Manipulates images on-the-fly. Minifies and combines (on-demand) css and javascript files.
License MIT
Homepage https://www.bootpress.org/components/asset.html
Please rate this library. Is it a good library?
Informations about the package asset
use BootPress\Asset\Component as Asset;
Asset::cached() is a one-stop method for all of your asset caching needs. This should be the first thing that you call. It checks to see if the page is looking for a cached asset. If it is, then it will return a response that you can $page->send()
. If not, then just continue on your merry way. When you $page->display()
your html, it will look for all of your assets, and convert them to cached urls.
- If an asset is found we give it a unique (5 character) id that then becomes the "folder", and we add the
basename()
to the end for reference / seo sakes.- http://example.com/page/dir/bootstrap.css will become http://example.com/...../bootstrap.css where 'bootstrap.css' means nothing, and ..... is the actual asset location.
- 60 alphanumeric characters (no 0's) ^ 5 (character length) gives 777,600,000 possible combinations.
- If a #fragment is located immediately after the asset, we'll remove the fragment and ...
- If it is a .css or .js file then we will combine them together so that http://example.com/page/dir/bootstrap.css#../default.css#user/custom.css will become http://example.com/.....0.....0...../bootstrap-default-custom.css and we'll minify and serve the /page/dir/bootstrap.css, /page/default.css, and /page/dir/user/custom.css files all at once.
- Otherwise we'll replace the name with it ie. http://example.com/page/dir/image.jpg#seo will become http://example.com/...../seo.jpg
- If you add a query string to images, we'll remove and save it with the filename ie. http://example.com/page/dir/image.jpg?w=150#seo will become http://example.com/...../seo.jpg only ..... will be different from the previous example, and the image.jpg's width will be 150 pixels.
- To see all of the options here, check out the Glide Quick Reference guide.
- The
filemtime()
is saved so that when an asset changes, we can give it a new unique filename that the browser will then come looking for and cache all over again.- This allows us to tell browsers to never come looking for the asset again, because it will never change.
- There is no better way to make your pages load any faster than this.
Installation
Add the following to your composer.json
file.
Example Usage
License
The MIT License (MIT). Please see License File for more information.
All versions of asset with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
bootpress/page Version ^1.0
bootpress/sqlite Version ^1.0
symfony/http-foundation Version ^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
league/glide-symfony Version ^1.0 || ^2.0
matthiasmullie/minify Version 1.3.*
xsirix/phpuri Version ^1.0
bootpress/page Version ^1.0
bootpress/sqlite Version ^1.0
symfony/http-foundation Version ^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
league/glide-symfony Version ^1.0 || ^2.0
matthiasmullie/minify Version 1.3.*
xsirix/phpuri Version ^1.0
The package bootpress/asset contains the following files
Loading the files please wait ....