Howto avoid browser to cache javascrpit files

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

Howto avoid browser to cache javascrpit files

Post by karu »

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: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Howto avoid browser to cache javascrpit files

Post by falsam »

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

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

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

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

Re: Howto avoid browser to cache javascrpit files

Post by karu »

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: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Howto avoid browser to cache javascrpit files

Post by Peter »

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
Post Reply