Priority: Enhancement
Current State: New
Released In: n/a
Target Release:
My proposal is that, once the HTML code has been generated, the plugin could parse that HTML code for <script src=...>, <link href=...> and <img src=...> statements and generate "H2PushResource" http header line for all files references there (if they reside on the local server).
Supposed configuration parameters for the local admin:
- Restrict pushing to files of a maximum size (0=push all files, negative value=don't push at all)
- Maybe restrict the aggregated total file size
- What kind of files shall be pushed: images (.png/.gif/.jpg/.jpeg/.webp), css (.css), javascript (.js), other (everything else)
I've attached some sample code. So far, it has no support for my proposed "aggregated total file size" restriction, but that shouldn't be a big thing.
--
ChristianKern - 03 Jun 2020
And yet another version which has support for pushing small files first. (If there's a maximum aggregated total size, one would probably prefer pushing many small files rather than one big file.)
--
ChristianKern - 03 Jun 2020
One other thing that would be helpful: An option to specify a regular expression that allows to push only elements that reside in certain paths (I'm thinking of /pub/System/ particularly).
--
ChristianKern - 03 Jun 2020
- ao.pl.txt: improved code: support for $max_aggregated_filesize, more lucid code
- ao.pl.txt: third version, with support for pushing small files first
- three_includefiles.tar.gz: The three files whose names the ao.pl.txt script finds in its sample HTML text. Use with max_filesize=8 and max_aggregated_filesize=15.
- ao.pl.txt: fourth version, with support for path restrictions