简体   繁体   中英

On cloudflare I want to disable caching and see my website changes immediately that I've pushed live

On cloudflare I want to disable caching and see my website changes immediately that I've pushed live.

Things I've tried:

  • I've put development mode on.
  • Create a bypass on caching in page rules.
  • Purged an individual webpage.
  • Purged the website.
  • Set cache to clear every 2 hours.

None of the above worked.

Tech I'm using:

  • Angular2
  • SystemJS
  • Typescript which becomes javascript on build.
  • Firebase for hosting and database.
  • Cloudflare for SSL etc.

The only way people see my website changes, it if they hard refresh.

The main problem is I've got a javascript file called app.js and its has all my javascript in for my Angular app. And it doesnt seem like its trying to get the resource in the browser.

I've changed the app.js to app.js?1490959855777 And still doesnt fetch the file again.

I basically want to see my JS file without a user having to hard refresh.

在此处输入图片说明

Based on the discussion above, it looks like the caching is happening on the browser - since a hard refresh will get the new file contents.

I think what happened is CF told the browser to hold onto that file for a very log time. And the browser is listening to that request.

Because you can't ask your users to do a hard refresh, you'll need to rename the static files that are being cached so aggressively.

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