Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear the browser's cache #21329

Closed
romulus001 opened this issue Jan 22, 2018 · 3 comments
Closed

Clear the browser's cache #21329

romulus001 opened this issue Jan 22, 2018 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@romulus001
Copy link

romulus001 commented Jan 22, 2018

Hello,
In an Ionic project (version 3.91), I do need to clear the browser's cache, how to do that?
On google, I understood I do need to add these http headers :

  • Cache-Control : no-cache, no-store, must-revalidate
  • Pragma : no-cache
  • Expires : 0 ( or an old date, I don't understand what exactly I do have to mention)
  • Vary : *

But I still have to manually clear the browser's cache (CTRL + F5) each time I update my web project, any idea? Here you have the http headers included to my project :

let myHeaders = new Headers();
myHeaders.append('Accept', 'application/json');
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Cache-Control','no-cache, no-store, must-revalidate');
myHeaders.append('Pragma','no-cache');
//myHeaders.append('Expires','0');
myHeaders.append('Expires', 'Wed, 4 Oct 2000 07:30:00 GMT');
myHeaders.append('Vary','*');

myHeaders.append('Access-Control-Allow-Origin', '*');
myHeaders.append('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
myHeaders.append('Authorization', 'Bearer ABCDEF0123456789');

Thanks

@jcalz
Copy link
Contributor

jcalz commented Jan 22, 2018

You had to walk past this to get here:

<!-- If you have a QUESTION:
   THIS IS NOT A FORUM FOR QUESTIONS.
   Ask questions at http://stackoverflow.com/questions/tagged/typescript
    or https://gitter.im/Microsoft/TypeScript
-->

@ghost
Copy link

ghost commented Jan 22, 2018

Look for an ionic help forum?

@ghost ghost closed this as completed Jan 22, 2018
@ghost ghost added the Question An issue which isn't directly actionable in code label Jan 22, 2018
@romulus001
Copy link
Author

it's not related to ionic

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants