How to disable cache on chrome for Android?

前端 未结 5 1730
南方客
南方客 2021-02-03 22:13

How to disable cache on chrome for Android?

I change my page content, and refresh the page, but the content still is old.

I have set the nginx c

5条回答
  •  日久生厌
    2021-02-03 22:52

    To disable the cache first you'll have to disable scripts / css caching on the ones you are editing.

    In order to do that, add a timestamp to your file inclusions :

    
    
    

    {{ts}} being a timestamp (I'm using jinja templating).

    Then if you edit your html page, you could change the request adding a random parameter to it as such :

    test 1 : mywebsite.com/this_page

    test 2 : mywebsite.com/this_page/?i=1

    test 3 : mywebsite.com/this_page/?i=2

    ...

    It's more a hack than a real solution, but chrome kindly ignores the cache-control meta, so there aren't lots of clean way to do it.

提交回复
热议问题