Website not using new code

html
javascript
css

#1

I have been doing some work on my website lately, and I have been realising that the code for the website is not always changing the website itself, I would add something new to the CSS and then when the page refreshed, it would not show these changes, and I would come back after a couple hours and the changes would finally be there, Why is this occuring?

With further testing I have came to notice, that it is only css files that do not show new changes until after some time.


#2

Hey @Callum-OKane I’m going to move the to Glitch Help since on the surface it sounds like unexpected behavior.

Can you let us know the project name you’re seeing this behavior on so we can take a closer look?


#3

The Project name is Time-Desert

I am going to send a video file in 2 minutes showing what I am occuring!


#4

In this video, you can see that the CSS is still visible on the page, even after it refreshed the page after removing the css, and in the video, I Have also noticed the webpage is not loading or taking some time to load other pages in the bots coding!
video link


#5

@cori Have you found anything about it?


#6

Here are the apache logs I was seeing in a remix after deleting and replacing the style.css content:

127.0.0.1 - - [27/Feb/2019:20:48:01 +0000] "GET /style.css HTTP/1.1" 200 243 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:48:22 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:48:25 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:48:41 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:49:11 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:49:15 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:49:32 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:50:00 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:50:12 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:50:44 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:51:42 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:52:47 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:58:24 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:58:24 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:59:29 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:59:29 +0000] "GET /style.css HTTP/1.1" 200 243 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:59:45 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:20:59:45 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:02 +0000] "GET /homepage.html HTTP/1.1" 200 1039 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:02 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/homepage.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:21 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:21 +0000] "GET /style.css HTTP/1.1" 200 243 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:49 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:00:49 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:11 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:11 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:23 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:23 +0000] "GET /style.css HTTP/1.1" 200 243 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:40 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:40 +0000] "GET /style.css HTTP/1.1" 304 142 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:41 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:42 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:42 +0000] "GET /style.css HTTP/1.1" 304 142 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:01:43 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:02:41 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:02:41 +0000] "GET /style.css HTTP/1.1" 304 142 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:02:55 +0000] "GET / HTTP/1.1" 200 7151 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"
127.0.0.1 - - [27/Feb/2019:21:02:55 +0000] "GET /style.css HTTP/1.1" 200 1409 "https://celestial-kiss.glitch.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 It's cori!"

so for a period there my browser wasn’t even requesting the style.css file from the server (this file is located at /app/.apache2/log/access.log).

When I look in the chrome developer tools, I see

which tells me that my browser is using the css file from my local disk cache and not requesting the updated one from the server, which is probably what you’re seeing as well. Typically (in Chrome, at least) when you open the developer tools and go to the Network tab it will default to disabling the disk case, in which case you should get the fresh info from the server every time.


#7

Why is it doing this?
I never even made this… https://celestial-kiss.glitch.me/, and even if I did, why is it using this?


#8

That’s my remix of your project for testing purposes, which I’ll delete when we’re done looking at this issue. Is that what you mean?


#9

There’s something called a browser cache. When you go to a website for the first time, your web browser needs to get the code for whatever page you’re viewing, plus all the extra stuff that the page will load (icons, other images, scripts, etc). When you go back to that site later that day, it will usually load faster than it did the first time, because all that stuff that your browser downloaded before is mostly the same. So the browser asks the site not to resend the things that haven’t changed—because the browser has stored it in the cache.

Sometimes this doesn’t work perfectly. The browser ends up showing you the old thing, even though there’s a newer version. Even when you press reload, the browser ends up using its cached version.

You can force your browser to do a hard refresh (Ctrl+Shift+R, or Cmd+Shift+R on Mac [probably?]). This will cause it to ignore the cached version, ask the website to resend everything that the page has on it, and ignore whatever the browser had cached. Pressing the shortcut to do a hard refresh when testing the effect of a change is a habit that a lot of people creating websites pick up early on.

To can read about the browser cache on Wikipedia: