Problems displaying my site in chrome

0

Hello, I'm having trouble showing my site in Google Chrome. I edit the codes mainly in the css, the mozila displays on the hour, but in chrome or it takes a lot (after updating about 20 times) that works, or does not update at all.

The problem is only with css. I'm making a theme for wordpress, so I use style.css

I call style like this:

<link href="<?php bloginfo('template_url'); ?>/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

I'm using 3 more css pages:

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" >
<link href="<?php bloginfo('template_url'); ?>/css/grayscale.css" rel="stylesheet">
<link href="<?php bloginfo('template_url'); ?>/css/agency.css" rel="stylesheet">

It was necessary to use them to get certain results that I wanted. I do not know if this is disturbing you. But I had the same problem on another theme I was developing and only used style and bootstrap. All this to make a website responsive as well.

    
asked by anonymous 24.01.2017 / 14:35

2 answers

3

Just transcribing the solution that was presented in the comments.

Failing to update the changes in the Chrome browser is the cache. If I'm not mistaken, locally at least Firefox also maintains versions of the cached files, but updates them if there is any change. Unlike Chrome, it takes time to update the cached files naturally. That is, once you've loaded the CSS file in Chrome, new changes will not work until the cache has been updated.

There are two possible solutions:

  • Clear the cache stored in the browser manually by following the steps in official website , Clear cache and cookies; or
  • Use HTML meta tags to control the page cache, as can be seen here .
  • In short, simply add the tag below so that browsers no longer cache the page.

    <meta http-equiv="Cache-Control" content="no-store" />
    
      

    Note : We recommend that you keep this setting only in the development environment. Once your site is complete and go to the production environment, keeping cache is extremely healthy and recommended as it slows down your page load time and also reduces traffic to your server.

        
    24.01.2017 / 17:41
    0

    The only thing that worked for me was to insert a hash that says there is a new version of css for chrome:

    <link rel="stylesheet" type="text/css" href="css/style.css?version=2">
        
    07.08.2018 / 05:19