강력 새로 고침 질문 드립니다

블레이저 wasm 으로 개발된 사이트가 있습니다

이걸 Maui Webview 로 뛰우거나

카카오톡 알림톡으로도 주소를 보내 카카오톡 브라우저로도 사이트가 뜨곤 합니다

근데

강력 새로고침이 되지 않아 오류가 나는 경우가 많습니다

PC로 접속시 어떻게 해서라도 강력 새로 고침 하세요 라고 하면 될텐데

카카오톡 브라우저에서는 새로고침 자체도 보이지 않고

새로고침 한다고 하여도 적용 안되는 경우들이 있는거 같습니다

강제적으로 사이트를 강력 새로고침 할수 있게 하는 방법들은 무엇이 있을까요

1개의 좋아요

Bing신의 답변입니다.
According to some web sources, it is possible to clear the Blazor cache in Blazor code by using the CacheStorage API1. This API allows you to store, retrieve, remove, and clear all stored values using the cache storage1. For example, you can use the following code snippet to clear the cache storage:

@inject IJSRuntime JSRuntime

@code {
    private async Task ClearCache()
    {
        await JSRuntime.InvokeVoidAsync("caches.delete", "blazor-resources-/"); // delete the cache for Blazor resources
    }
}

You can also use the cache-control header to prevent caching of the blazor.webassembly.js file, which is responsible for loading the Blazor assemblies2. You can either add the header to the HTTP response from the server, or manually add a cache-busting parameter to the script tag that loads the file2. For example:

<script src="blazor.webassembly.js?version=1.0.0"></script>

Another option is to use the browser’s developer tools to clear the cache manually3. You can do this by right-clicking the refresh page icon on the browser and choosing Empty cache and hard reload3. This will force the browser to reload the blazor.boot.json file, which lists the assemblies and their hashes3. If the cached files have changed, they will be reloaded3.

I hope this helps you with your question. :blush:

참고로, 블레이저의 캐시 이름은 “blazor-resources-/” 입니다.

1개의 좋아요

강력 새로고침과 그냥 새로고침은 캐쉬를 지우는것 한가지 였군요 해보겠습니다 감사합니당!

1개의 좋아요