I have no idea what is happening. I don't even know what information would be relevant, so please ask me anything you think could be related. The problem: I write a html script and css to modify it. I put the files on my webserver (Apache2 running on Ubuntu 22.04) and they work perfectly. I can modify the css script (e.g. changing font sizes, margins etc.) and the changes show up on the corresponding html. Yet, if I leave the laptop alone for an hour or so (not changing a thing), and I modify the css script it has zero effect on the corresponding html. It's as if no changes have been made. I can delete the files, write them over again and they work fine; leave it alone for a period of time and it no longer works. This holds true for all my html/css files. All help is greatly appreciated. Thanks.
I tried restarting Apache, restarting the laptop, rewriting the files, renaming the files, moving the files. No matter what I do, after a period I can no longer modify the html with css.
The first step would be to identify the source of the issue. This can be done by checking the Apache server error logs, as well as any other relevant logs from the Ubuntu OS. The error logs may help identify the root cause of the problem, such as a configuration issue or a software bug.
Once the source of the issue is identified, the next step is to attempt to troubleshoot the problem. This could include checking the web server's configuration, ensuring the correct permissions are set for the HTML and CSS files, and ensuring the server has the correct modules installed to support HTML and CSS.
Additionally, it may be helpful to check the browser's cache to ensure the HTML and CSS files are being served correctly, as a cached version of the page may be loading instead of the updated version.
Finally, it could be helpful to test the same setup with a different web server, such as Nginx, to determine if the issue is with the server or something else.
Ultimately, the devil in the details may be something as simple as a configuration issue or a software bug, or it may be something more complex such as an issue with the browser's cache. Identifying the root cause of the issue will be key to resolving the problem.
Related
So there is some kind of caching issue going on with chrome lately.
I updated an image on a web page, but it will not update in chrome. Other browsers are fine.
Also I'm going to note that I changed the html, and gave the image a new name to force browsers to grab the updated version.
i.e image.jpg > image-v1.jpeg
How on earth does chrome not grab the updated version of this?
Anyone seen this going on lately and know of a fix.
Thanks
When you clear browsing data, make sure to check the box to clear cached images, also make sure the duration is set to "All time".
https://i.ibb.co/jzYk6DK/ex.png
If that doesn't work, try renaming the image.
If that also doesn't work, take a look at the web server configuration expiry headers, and check the duration for cached images in your format. It could be in .htaccess, or it could be elsewhere depending on if you're using apache2 or Nginx.
For anyone stumped on this kind of an issue, if you are using a web farm check to make sure DFS replication across the servers is working correctly.
It was failing for one server in my case, this is why some users got the updated version while others didn't.
to verify if replication worked, log into the servers via RDP then check the last modified date time stamps for the file(s) in question.
This may sound like a very basic question but I feel like I've tried everything.
This a follow-up to this post I made earlier, where I resolved the issue, only for it to come back again.
To summarize, I was making some change to the contact.css file on the contact page of my website when I noticed the changes were working offline but didn't appear online. I narrowed this issue down to a caching issue with the above post (others could see the changes but I couldn't).
In the above example I couldn't get my website to show up as background-color:blue - eventually it worked and I thought I'd fixed it... So I go to change the color back to normal and boom, it stops refreshing the changes again.
So I think it's some sort of caching issue but for the life of me I can't get my cache to clear properly so that I can refresh and see the changes.
Here are the things I have tried already:
Clearing cache (many times) on Chrome, Firefox, and Opera
Hard refresh on Chrome, Firefox, and Opera
Disabling cache through dev tools on Chrome and Firefox (this worked initially then stopped working when I re-updated the website)
Checked multiple times that the CSS file uploaded correctly and the file path was correct. This was confirmed because the correct changes were seen by other people.
Flushed my DNS
Changed from my ISPs DNS to google's 8.8.8.8 + 8.8.4.4
I'm using HostGator to host my website, I'm wondering at this point whether it's something to do with them? I really just have no idea at this point.
Here's what I see online:
Here's what I should be seeing and what I do see on the offline version of my website:
I noticed you said "I'd really like to get to the bottom of the underlying issue" so I figured I'd write an answer to provide a few options (and if anyone wants me to add others, please feel free to add a comment). Overall though, determining your root cause is likely much harder than just solving your overall problem, but let's start with possible causes that I can think of off my head:
Multiple CDN servers taking a while to update so some are returning the old data (your current session) and some are returning new (incognito)
Server session caching so when you reload the page within one http context session you get back the same content (I've seen this in product search queries for example)
The solution to this is relatively simple though, it's called cache busting. Basically, every time you update your source code just add a unique key in either the query string, file name or something to make the url unique. For example, for your css you can link https://path/to.css?v2.0.1 and just keep increasing the version number as you go. If you use webpack for your build outputs, they have a content hash variable that you can use as a token in the file names.
As for the CDNs possibly caching things out of date... the content hash solution will solve that problem as it's an entirely different file name so the CDN will go get it from the root if it doesn't have it in it's cache. I'm unsure of the url version query parameter will do the same, maybe someone else could shed some light on that.
Have you tried using Incognito in Chrome?
we are developing a VueJS based application. We have huge caching problem.
Team members are constantly updating the site but we are getting feedbacks about the solved problems such as typos and miss placed elements.
I personnaly tried the inspect this situation, I found that Chrome reads the files from disk cache or memory cache until the page is refreshed. Even though sometimes chrome still loads the old page when we are re entering the site again (after the refreshing process (ctrl + shift + r)).
I' m sorry for my bad english but I tried my best to explain what I encounter. Also I found a topic about the problem, OP has explained the what I was encounteing. You can also check that out.
How to clear cache of service worker?
I created a website on IIS (local machine windows 10), published the project and tried to reaching it with local ip adress (127.0.0.1:8093), in the network tab I can see the .js and .css files being downloaded then I restart the browser and tried again, this time files are being served from disk cache, I tried couple of times and sometimes files are served from cache and sometimes downloaded.
I tried to add serviceWorker but I got empty handed. Also I created a base project to test some vuejs features and I added same serviceWorker code to the project. It cached again.
Our servers is windows 2012 server with IIS 8.
If it is possible we want no-caching approach or we want to manage what's cached and not. If you can help we would be appreciated.
You can checkout the base project
vue-base project
What I tried
As I said above I tried to add service workers as github commit,
https://github.com/vuejs-templates/pwa/pull/21/files
Also I tried deleting the cached data caches.delete(cacheName) did not seem to work.
I don't know if the serviceworkers related to this problem but did not solve my problem. May be I could not add the code properly. If you can help I would be very appreciated.
Thank you for your helps.
Edit1: Screen GIF
I dont know what you have been using to bundle your code and assets, but with webpack it is possible to create the files with a hashcode, which means that everytime the browser finds a new file reference in your browser it will download it.
Ex: you deployed yesterday a code which contained main.34534534534.js
Today you deploy again but the file is main.94565342.js. Your browser will automatically invalidate cache.
I was wondering if anybody could direct me to any tools for debugging the cache.manifest file in offline HTML5 access. I recently downloaded a program called Manifesto which allows me to look up the cache manifest on loading a page. Everything seems to working fine however it keeps on saying that the status is "uncached". Obviously, it seems like although it is checking to make sure the cache files are there, it isn't actually caching them upon load. Whats going on and more importantly, how do I figure out how to solve it?
I got it to work. To be honest, it might have been working before but because I was having some different php scripts running in the background I had to be a little careful with pulling it up.
Found an interesting article about "Cruftless" links (removing the "index.html" from links) but when I do that no browser shows the local pages.
http://www.nimblehost.com/blog/2012/11/why-cruftless-links-are-better/,
This is understandable, it's a 'file' url from a local machine, so what do people do to work on basic html sites offline? How do they preview them?
For example, no browser (understandably) will display this...
file:///JOBS/ABC/About/
... but this is fine...
file:///JOBS/ABC/About/index.html
?... so what do people do to get around this?
The meaning of file: URLs is, by definition, system-dependent. Normally browsers map them to files in the file system in a relatively straightforward manner.
Thus, a link with href value like file:///JOBS/ABC/About/ may or may not work, depending on system. It may fail, or it may open a generated document containing a directory (folder) listing, or it might do something else.
There is normally no need to get around this, and it is pointless to worry about SEO when dealing with local files.
This could, however, matter during site development when you work with a site locally (and perhaps test and demonstrate it locally). Then you might wish to have, say, About us so that it works locally as well as on a server, yielding About/index.html in both cases but without hard-wiring index.html in HTML markup.
I’m afraid the answer is “you can’t”. But as a workaound, you can install and use a local HTTP server, with settings similar to those that you will have on the real server. This means a little extra work (mainly downloading and installing and configuring software like XAMPP), but it also gives you important other benefits, like testing your pages locally with server-based features (to the extent that the real server is similar to the local server).