Just starting out? Need help? Post your questions and find answers here.
karu
 
Posts: 39
Joined: Mon Feb 24, 2014 10:16 pm

Howto avoid browser to cache javascrpit files

by karu Fri Dec 15, 2017 1:31 pm

Typical ways not help, i tried to put in html header these lines, but no help:
<meta http-equiv="cache-control" content="max-age=0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="expires" content="Tue, 01 Jan 1980 11:00:00 GMT">
<meta http-equiv="pragma" content="no-cache">

Can someone tell me how to avoid browser to cache?
falsam
 
Posts: 235
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Howto avoid browser to cache javascrpit files

by falsam Fri Dec 15, 2017 3:31 pm

For each line use !$('head').append(' ')

Example : !$('head').append('<meta http-equiv="cache-control" content="max-age=0">')
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood ☀️
http://falsam.com

Sorry for my poor english
karu
 
Posts: 39
Joined: Mon Feb 24, 2014 10:16 pm

Re: Howto avoid browser to cache javascrpit files

by karu Thu Dec 21, 2017 7:00 am

falsam wrote:For each line use !$('head').append(' ')

Example : !$('head').append('<meta http-equiv="cache-control" content="max-age=0">')


Sorry my bad english but what do you mean "For each line use"?
User avatar
Peter
 
Posts: 445
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: Howto avoid browser to cache javascrpit files

by Peter Thu Dec 21, 2017 11:52 am

karu wrote:what do you mean "For each line use"?

each of your meta lines:

Code: Select all
!$('head').append('<meta http-equiv="cache-control" content="max-age=0">');
!$('head').append('<meta http-equiv="cache-control" content="no-cache">');
!$('head').append('<meta http-equiv="expires" content="-1">');
!$('head').append('<meta http-equiv="expires" content="Tue, 01 Jan 1980 11:00:00 GMT">');
!$('head').append('<meta http-equiv="pragma" content="no-cache">');


but I doubt it's not the right approach...

Greetings ... Peter
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 2 guests