Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • duanleou90 14 posts 65 karma points
    Feb 03, 2023 @ 07:17
    duanleou90
    0

    Can Not Clear CSS Cache

    Hi everyone,

    Currently, I'm working on a Umbraco 10 project and hosting it on Azure app service.

    Every time when I deployed css file to webroot folder (overwrite the existing one). The website is not affected by the new css file (it still refers to the old one).

    I tried either restarting the website or adding "?version=xxx" to css url. But none of them work.

    Does anyone here know how to clear the css cache?

    Thanks!

  • Roy Berris 89 posts 577 karma points c-trib
    Feb 03, 2023 @ 08:29
    Roy Berris
    0

    Hi,

    This is client-side cache. You don't really have control over it in the back-end unless you change the file path. Adding a query parameter technically changes this.

    What should work is appending anything to the URL like ?version. Are you sure the version is different after deploy?

    If not, check the response headers when getting the resource.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

  • duanleou90 14 posts 65 karma points
    Feb 03, 2023 @ 09:42
    duanleou90
    0

    Hi Roy,

    It's not client-side here. Because after deploying, even when I use Ctrl+F5, the website still refer to old version of css file.

    I tried to add ?v=1.0.0 to css path, but got the same issue.

    The website only get new css rules if i change css file name and refer to this file.

    So i believe that the old version of css file was cached somewhere but so far i don't know how to clear the cache :(

Please Sign in or register to post replies

Write your reply to:

Draft