Welcome Guest, Not a member yet? Register   Sign In
Views not reflecting code, html or css changes
#1
Question 

Whenever I change my view code, html or css it takes really long (~60 sec.) to reflect in my local browser. However if I have for example a list view and add a database item it show right away. It feels like a caching problem but I have tried several things already after googling this issue.

Specs:
  • Windows 11 Home 21H2
  • CI 4.2.4
  • Bitnami WAMP 8.1.9
  • Running in development mode
What have I tried:
  • Deleting cache from browsers (Chrome/Edge)
  • The welcome_message view shows the same slow change behaviour
  • In BaseController and MyController
Code:
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.
$this->response->noCache();
$this->cachePage(3);
  • In Config/Cache.php
Code:
public $ttl = 3;
  • Tried changing files in other editors (maybe Jetbrains IDE was updating slow)
  • Checked CI dev bar. Page loads quickly.
  • Running in Production mode. Still slow.
Reply
#2

to prevent cache problem, maybe give the css file a different name each time you change it eg mystyle_01.css and increment the _01 accordingly. Then either manually update it in your html view or run a small function in the controller to pick the css file with the highest number and pass this to the view.
Reply
#3

(This post was last modified: 08-21-2022, 07:01 PM by prasedenica.)

Launch Chrome on your machine.
1. Click More in the upper right corner.
2. Select More tools. Clear your browsing history.duck life
3. Select a time range at the top. Select All time to erase everything.
4. Check the boxes next to "Cookies and other site data" and "Cached pictures and files."
5. Select Clear data.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB