From 6b3987615d13633e967972399ffedc5782d3769b Mon Sep 17 00:00:00 2001 From: Renato Marinho Date: Thu, 14 Sep 2017 23:42:01 +0100 Subject: [PATCH] config and files to the middlewares --- config/laravel-page-speed.php | 40 ++++++++++++++++++- src/Middleware/CombineCss.php | 21 ++++++++++ src/Middleware/CombineHeads.php | 21 ++++++++++ src/Middleware/CombineJavascript.php | 21 ++++++++++ src/Middleware/DedupInlinedImages.php | 21 ++++++++++ src/Middleware/DeferJavascript.php | 21 ++++++++++ src/Middleware/ElideAttributes.php | 21 ++++++++++ src/Middleware/ExtendCache.php | 21 ++++++++++ src/Middleware/FallbackRewriteCssUrls.php | 21 ++++++++++ src/Middleware/FlattenCssImports.php | 21 ++++++++++ src/Middleware/HintPreloadSubresources.php | 21 ++++++++++ src/Middleware/InLineGoogleFontCss.php | 21 ++++++++++ src/Middleware/InLineImportToLink.php | 21 ++++++++++ src/Middleware/InLineJavascript.php | 21 ++++++++++ src/Middleware/InLinePreviewImages.php | 21 ++++++++++ src/Middleware/InlineCss.php | 21 ++++++++++ src/Middleware/InsertDNSPrefetch.php | 21 ++++++++++ src/Middleware/InsertGA.php | 21 ++++++++++ src/Middleware/LazyLoadImages.php | 21 ++++++++++ src/Middleware/LocalStorageCache.php | 21 ++++++++++ src/Middleware/MakeGoogleAnalyticsAsync.php | 21 ++++++++++ src/Middleware/MakeShowAdsAsync.php | 21 ++++++++++ src/Middleware/MoveCssAboveScripts.php | 21 ++++++++++ src/Middleware/MoveCssToHead.php | 21 ++++++++++ src/Middleware/OutlineCss.php | 21 ++++++++++ src/Middleware/OutlineJavascript.php | 21 ++++++++++ src/Middleware/Pedantic.php | 21 ++++++++++ src/Middleware/PrioritizeCriticalCss.php | 21 ++++++++++ src/Middleware/RemoveComments.php | 21 ++++++++++ src/Middleware/RemoveQuotes.php | 21 ++++++++++ src/Middleware/ResizeMobileImages.php | 21 ++++++++++ .../ResizeRenderedImageDimensions.php | 21 ++++++++++ src/Middleware/ResponsiveImages.php | 21 ++++++++++ src/Middleware/RewriteCss.php | 21 ++++++++++ src/Middleware/RewriteImages.php | 21 ++++++++++ src/Middleware/RewriteJavascript.php | 21 ++++++++++ src/Middleware/RewriteStyleAttributes.php | 21 ++++++++++ .../RewriteStyleAttributesWithUrl.php | 21 ++++++++++ src/Middleware/SpriteImages.php | 21 ++++++++++ src/Middleware/TrimUrls.php | 21 ++++++++++ 40 files changed, 858 insertions(+), 1 deletion(-) create mode 100644 src/Middleware/CombineCss.php create mode 100644 src/Middleware/CombineHeads.php create mode 100644 src/Middleware/CombineJavascript.php create mode 100644 src/Middleware/DedupInlinedImages.php create mode 100644 src/Middleware/DeferJavascript.php create mode 100644 src/Middleware/ElideAttributes.php create mode 100644 src/Middleware/ExtendCache.php create mode 100644 src/Middleware/FallbackRewriteCssUrls.php create mode 100644 src/Middleware/FlattenCssImports.php create mode 100644 src/Middleware/HintPreloadSubresources.php create mode 100644 src/Middleware/InLineGoogleFontCss.php create mode 100644 src/Middleware/InLineImportToLink.php create mode 100644 src/Middleware/InLineJavascript.php create mode 100644 src/Middleware/InLinePreviewImages.php create mode 100644 src/Middleware/InlineCss.php create mode 100644 src/Middleware/InsertDNSPrefetch.php create mode 100644 src/Middleware/InsertGA.php create mode 100644 src/Middleware/LazyLoadImages.php create mode 100644 src/Middleware/LocalStorageCache.php create mode 100644 src/Middleware/MakeGoogleAnalyticsAsync.php create mode 100644 src/Middleware/MakeShowAdsAsync.php create mode 100644 src/Middleware/MoveCssAboveScripts.php create mode 100644 src/Middleware/MoveCssToHead.php create mode 100644 src/Middleware/OutlineCss.php create mode 100644 src/Middleware/OutlineJavascript.php create mode 100644 src/Middleware/Pedantic.php create mode 100644 src/Middleware/PrioritizeCriticalCss.php create mode 100644 src/Middleware/RemoveComments.php create mode 100644 src/Middleware/RemoveQuotes.php create mode 100644 src/Middleware/ResizeMobileImages.php create mode 100644 src/Middleware/ResizeRenderedImageDimensions.php create mode 100644 src/Middleware/ResponsiveImages.php create mode 100644 src/Middleware/RewriteCss.php create mode 100644 src/Middleware/RewriteImages.php create mode 100644 src/Middleware/RewriteJavascript.php create mode 100644 src/Middleware/RewriteStyleAttributes.php create mode 100644 src/Middleware/RewriteStyleAttributesWithUrl.php create mode 100644 src/Middleware/SpriteImages.php create mode 100644 src/Middleware/TrimUrls.php diff --git a/config/laravel-page-speed.php b/config/laravel-page-speed.php index 157b9b0..6c4c371 100644 --- a/config/laravel-page-speed.php +++ b/config/laravel-page-speed.php @@ -12,6 +12,44 @@ 'filters' => [ 'collapse_whitespace' => true, - + 'remove_comments' => true, + 'combine_css' => false, + 'combine_heads' => false, + 'combine_javascript' => false, + 'dedup_inlined_images' => false, + 'defer_javascript' => false, + 'elide_attributes' => false, + 'pedantic' => false, + 'extend_cache' => false, + 'fallback_rewrite_css_urls' => false, + 'flatten_css_imports' => false, + 'hint_preload_subresources' => false, + 'inline_css' => false, + 'inline_google_font_css' => false, + 'inline_import_to_link' => false, + 'inline_javascript' => false, + 'inline_preview_images' => false, + 'insert_dns_prefetch' => false, + 'insert_ga' => false, + 'lazyload_images' => false, + 'local_storage_cache' => false, + 'make_show_ads_async' => false, + 'make_google_analytics_async' => false, + 'move_css_above_scripts' => false, + 'move_css_to_head' => false, + 'outline_css' => false, + 'outline_javascript' => false, + 'prioritize_critical_css' => false, + 'remove_quotes' => false, + 'resize_mobile_images' => false, + 'resize_rendered_image_dimensions' => false, + 'responsive_images' => false, + 'rewrite_css' => false, + 'rewrite_images' => false, + 'rewrite_javascript' => false, + 'rewrite_style_attributes' => false, + 'rewrite_style_attributes_with_url' => false, + 'sprite_images' => false, + 'trim_urls' => false ] ]; \ No newline at end of file diff --git a/src/Middleware/CombineCss.php b/src/Middleware/CombineCss.php new file mode 100644 index 0000000..1319493 --- /dev/null +++ b/src/Middleware/CombineCss.php @@ -0,0 +1,21 @@ +