PHP files do not update CSS and Javascript changes

Asked

Viewed 763 times

-1

This had already happened to me before, but I solved by giving a CTRL + F5. Now NOTHING helps. I’ve restarted wamp several times, even restarted the computer and nothing. The funny thing is that it only happens in php pages. HTML pages are updating normally. I know it’s a cache problem, but I don’t know what to do about it.

    <html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../css/pequeno.css" media="screen and (min-width: 0px)" rel="stylesheet" type="text/css">
    <link href="../css/medio.css" media="screen and (min-width: 1000px)" rel="stylesheet" type="text/css">
    <link href="../css/estilo.css" media="screen and (min-width: 1500px)" rel="stylesheet" type="text/css">
    <title>Página principal</title>
  </head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="scripts.js"></script>

1 answer

0

Then, put a random number at the end of each file, so the browser won’t find it in the cache and will fetch it on the server.

<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../css/pequeno.css?<?php echo rand(1, 1000);?>" media="screen and (min-width: 0px)" rel="stylesheet" type="text/css">
<link href="../css/medio.css?<?php echo rand(1, 1000);?>" media="screen and (min-width: 1000px)" rel="stylesheet" type="text/css">
<link href="../css/estilo.css?<?php echo rand(1, 1000);?>" media="screen and (min-width: 1500px)" rel="stylesheet" type="text/css">
<title>Página principal</title>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="scripts.js?<?php echo rand(1, 1000);?>"></script>
  • Hi Leo. I did exactly as you posted and it didn’t help. I restarted the server again and nothing either. Is it possible that the problem is on the server? The strange thing is that until last night I was managing to make the changes normally and suddenly stopped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.