Page 1 of 1

Howto avoid browser to cache javascrpit files

Posted: Fri Dec 15, 2017 1:31 pm
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?

Re: Howto avoid browser to cache javascrpit files

Posted: Fri Dec 15, 2017 3:31 pm
by falsam
For each line use !$('head').append(' ')

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

Re: Howto avoid browser to cache javascrpit files

Posted: Thu Dec 21, 2017 7:00 am
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"?

Re: Howto avoid browser to cache javascrpit files

Posted: Thu Dec 21, 2017 11:52 am
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