siteorigin / laravel-page-cache Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This package should allow site owners to configure CDN cache purging when a page changes. This would allow for very long edge caching times.
This would involve listening for the PageRefreshed
event and creating a purge request job when the page is changed.
We should create a CDN Purging contract so we can support multiple CDNs. To start, we'll have support for Cloudflare and possibly Fastly.
We should give a way for users to perform various optimizations on HTML after it's generated.
This would involve listening for the PageRefreshed
event and creating a job that runs a post processing stack of commands on the file.
We should still store a raw version of the html with the original filename. This will help all our existing change detection code to run properly. We'll also just store a separate .min.html
file and have our Apache and Nginx configurations try for these minified versions first. We'll also need to make sure we delete these minified files when a cached page is refreshed.
Developers should be able to configure which commands they include in a stack, with each ideally being defined as a class so devs can add their own. This should work in a similar way to Laravel's Middleware.
2 post processing commands we could include are:
It would be better to use tmpfile for our temporary file here in the OptimizeHtml
job. This means each optimizer would need to deal with a file handle instead.
Optimizers that need a filename, would just use stream_get_meta_data like this: https://stackoverflow.com/a/7690726
And then just closing the file handle at the end will automatically remove it from the filesystem. It all just seems safer.
The main idea is to replace the two console commands Install Nginx
and Install Apache
, with one blade page.
Besides hints on what settings should be added to the server configuration, we can also add a "check configuration" button and add some statistics about the cached pages.
This solution could potentially speed up the installation and configuration of this package.
It's possible we could use Puppeteer along with Imgix JS to create an optimization step that automatically checks image sizes at different browser sizes (standard desktop and mobile resolutions). Using this it could create a highly optimized srcset attribute that only includes sizes that will actually be used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.