Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Does browser always refetch if the new created link tag has the same href ?  #1141

Description

@JSerFeng

What's the purpose for setting preload rel after fetching the new style

When a css file updates, mini-css-extract will fetch the new link tag, and once done, it will set rel as preload and as as css.

https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js#L1103-L1107

Is this just for disabling the new style rendering ?

Make a link whose href is the same with an already loaded link tag, will browser fetch the new style ?

I have a link tag whose href is foo.css, and the update happens fast, mini-css-extract creates an new link tag, whose href is still foo.css, but sometimes the browser doesn't make request at all, I assume that this is the default behavior for browsers: when you create a link tag whose href is the same as an already loaded tag in a short time, browsers can assume these 2 tags are the same and do not make requests.

This happens usually when enable lazy compilation

I tried to find out in HTML spec and Dom spec but no luck, maybe is my carelessness. Still trying to make an repro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions