0

I’m a beginner web developer, I need help as my web page img updates do not auto refresh on client side devices. I’ve tried adding ?v=1 to img src and css. Does not work. Tried full hosting img url in css. Does not update. Is there a way to clear the pc and mobile devices cache so my page updates everywhere when adding content and changing background img.

 
 head...
  <!--custom stylesheet-->
  <link rel="stylesheet" type="text/css" href="css/style.css?v=1">
  <link rel="stylesheet" type="text/css" href="css/main.css?v=1" />

body...
 <img src="img/logo.webp?v=1" alt="logo" />

stylesheet...
background: url(../img/landing/body2.webp?v=1);

1 Answers1

0

I figured it out, I was editing the img files and saving to original file names. This caused problems with the client side image. So I renamed my img and added a date time stamp as ?v=(current date). I added the date time stamp to img, url, src in html body and head css and everywhere I edited something.

head...
  <!--custom stylesheet-->
  <link rel="stylesheet" type="text/css" href="css/style.css?v=30Jun2020125632">
  <link rel="stylesheet" type="text/css" href="css/main.css?v=30Jun2020125632" />

body...
<img src="img/logos.webp?v=30Jun2020125632" alt="logo" />

stylesheet...
  background: url(../img/landing/body2.webp?v=30Jun2020125632);