0

I have a problem about CSS in my codeigniter project.

I have separate views for header, footer and for rest of the pages. I have loaded my CSS files inside the header view. every thing is working great. Only problem is that when I make a change inside my CSS file it wont show up even after refreshing the page. It will only show up if I restart the whole PC. I know this is not a very big problem, but it is making it harder to debug the project. I just want you guys to tell me what is it that i am missing or doing wrong.

Thank you in advance.

P.S. i am student, new to codeigniter and also new to STACK OVERFLOW, so please think twice before down voting my question

This is my HEADER.

<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="Colorlib Templates">
  <meta name="author" content="Colorlib">
  <meta name="keywords" content="Colorlib Templates">
  <title>User Authorization </title>
  <link href="<?php echo base_url();?>assets/vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
    <link href="<?php echo base_url();?>assets/vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <!-- Font special for pages-->
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

    <!-- Vendor CSS-->
    <link href="<?php echo base_url();?>assets/vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="<?php echo base_url();?>assets/vendor/datepicker/daterangepicker.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="<?php echo base_url();?>assets/css/main.css" rel="stylesheet" media="all">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>

1 Answers1

0

Should be a caching-problem. Please try to clear your cache, or disable caching.

In Firefox and Chrome you should be able to reload the page with cleared cache by pressing ctrl + F5. (This could work in other browsers, too. But havn't tested)

To get rid of the caching-problem you could try to set the following meta-tags in your head:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> 

to learn more take a look at this answer

jsadev.net
  • 2,800
  • 1
  • 16
  • 28