Open Closed

MVC Bundling & Minification : Abount Google Page Speed #1954


User avatar
0
changyenshung created
  • ABP Framework version: v4.3.3

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): no

  • Exception message and stack trace: Reference : https://docs.abp.io/en/abp/4.4/UI/AspNetCore/Bundling-Minification

  • Steps to reproduce the issue:" 1.Use abp suite create project (included Public) Lepton Theme
    2.deploy it to iis and use page speed (LightHouse) to scan

1.Dose abp-style-bundle or abp-style-bundle provide async loading ? if i create a bundle with name(Unify.Globall). <abp-style-bundle name="@UnifyThemeBundles.Styles.Global" />``<abp-script-bundle name="@UnifyThemeBundles.Scripts.Global" />
the render result is
<link rel="stylesheet" href="/__bundles/Unify.Global.9B494C08AF327BA4383EC09ACFB31C89.css?_v=637691929446285346" />.
I want it render as <link rel="preload" href="/__bundles/Unify.Global.9B494C08AF327BA4383EC09ACFB31C89.css?_v=637691929446285346" /> to solve page speed issue

2.What if bootstrap or jquery come from CDN ,Write Directly on Default.cshtml(Layout Page) without abp-bundle?

PS.I buy a theme from ThemeMarket, some of js,css cant not be use cdn and i also need to make google page speed with green score(90~100).


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    1

    You can try to override the AbpTagHelperStyleService.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs#L46

    2

    You can remote some js or css from the Bundling.

    https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification#bundle-contributors

  • User Avatar
    0
    changyenshung created

    thanks, i will try this.

    Dose abp have any plan to add more tag service for solve this? 1.load CSS Asynchronously 2.script async defer loading ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Yes,

    https://github.com/abpframework/abp/issues/10306

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11