简体   繁体   中英

How to send cache-control: no-cache from mobile?

we're using Varnish for caching our pages, and it is configured to differentiate user-agent versions of pages. So mobiles will have different version of page than desktop browser.

From a desktop browser, it's easy to send a "cache-control: no-cache" with CTRL+F5 shortcut. It will enforce Varnish to refresh the page in its cache.

But how to do the same thing from a mobile, how do not have any CTRL key ??

Many thanks Etienne

As i know, just three options available on different browsers:

  1. Slide down
  2. Settings -> Refresh
  3. Settings -> Privacy -> Clear cache (All/For this site only)

If 1 and 2 doesn't help you just make extra click to clear cache manually

UPDATE: Ok I check safari and chrome at this site : it seems like you cannot send pragma: no-cache , from browser, only programmatically via meta tags, so there is no way to do it

The only solution I found :

  • Install App "Rest Client For Android"
  • paste the URL
  • add custom HTTP header "Cache-control: no-cache"

In the response, Varnish (depends on your config) add an http header who says "missed" = response doesn't come from the cache.

Many thanks Etienne

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM