Live Reload

Last updated Apr 23, 2026 Miniflare automatically refreshes your browser when your Worker script changes when liveReload is set to true.

const mf = new Miniflare({
    liveReload: true,
});

Miniflare will only inject the <script> tag required for live-reload at the end of responses with the Content-Type header set to text/html:

export default {
    fetch() {
        const body = `
      <!DOCTYPE html>
      <html>
      <body>
        <p>Try update me!</p>
      </body>
      </html>
    `;

        return new Response(body, {
            headers: { "Content-Type": "text/html; charset=utf-8" },
        });
    },
};

Was this helpful?

YesNo

On this page

Live Reload - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/testing/miniflare/developing/live-reload/#page","headline":"Live Reload","description":"Enable automatic browser refresh in Miniflare when your Workers script changes during local development.","url":"https://developers.cloudflare.com/workers/testing/miniflare/developing/live-reload/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/testing/miniflare/developing/live-reload/og.png?v=2d136a4ce470ca0b","dateModified":"2026-04-23","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Install and configure the Miniflare API to dispatch events and test Cloudflare Workers locally. title: Get Started image: https://developers.cloudflare.com/workers/testing/miniflare/get-started/og.png?v=d2fdc9dd705cddd5


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.