Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

CSS file changes do not take effect until cache is cleared

  • 9 réponses
  • 1 a ce problème
  • 3 vues
  • Dernière réponse par cjsmall

more options

Firefox 44.0 Xubuntu 15.10

I have HTML web pages that reference an external css file.

<link rel="stylesheet" type="text/css" href="arch.css" />

I am editing and saving the changes to the arch.css file and then reloading the HTML page, but nothing updates. I discovered that if I clear the cache then the css file will be reread and the changes take effect upon the next reload.

This has not been my experience with Firefox in the past. Has something changed and how can I change this behavior so that all changes to the css are immediately reflected on the page?

I changed browser.cache.check doc from the default "3" to "1" and this had no effect so I set it back to "3". Both browser.cache.disk.enable and browser.cache.memory.enable are set to the default "true"

Other suggestions?

Firefox 44.0 Xubuntu 15.10 I have HTML web pages that reference an external css file. <link rel="stylesheet" type="text/css" href="arch.css" /> I am editing and saving the changes to the arch.css file and then reloading the HTML page, but nothing updates. I discovered that if I clear the cache then the css file will be reread and the changes take effect upon the next reload. This has not been my experience with Firefox in the past. Has something changed and how can I change this behavior so that all changes to the css are immediately reflected on the page? I changed browser.cache.check doc from the default "3" to "1" and this had no effect so I set it back to "3". Both browser.cache.disk.enable and browser.cache.memory.enable are set to the default "true" Other suggestions?

Toutes les réponses (9)

more options

You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.

  • Hold down the Shift key and left-click the Reload button
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Command + Shift + R" (Mac)
more options

Cor-el: Thanks for the suggestions, but none of this works. I change a color in the css file and then I try:

Shift-Reload Ctrl-F5 Ctrl-Shift-R Reload Frame (through mouse motion definition) Reload Document (through mouse motion definition)

And in no case does the page update with the new color.

I then click on History->Clear Recent History (or Ctrl-Shift-Del), Select Cache and click OK. After this step, a simple reload does displays the change.

Other suggestions? I'm thinking there is some sort of bug in the recent releases of Firefox.

Modifié le par cjsmall

more options

You appear to be using the Ubuntu branded Firefox version from the repositories.

Does this also happen with the official release from the Mozilla server?

more options

I just downloaded the 44.0 Linux-64bit release from your link above and yes, it acts identically to the packaged version.

more options

I don't think I've seen a case where Ctrl+Shift+r did not bypass the cache.

If you open the Network Monitor and then press Ctrl+Shift+r, is Firefox showing that it is using the cached file even in that case?

https://developer.mozilla.org/docs/Tools/Network_Monitor

Also, not that it should make any difference, are you accessing the site on a file:// URL, or an http:// or https:// URL?

more options

Interesting. I never used the network monitor before. BTW, my HTML file has links to a large number of image files. See below.

The HTML file is being accessed through my apache server using http:// protocol.

No matter what method I use, including Ctrl-Shift-R, only the HTML and the css file are reported as being transferred from the cache -- even if each of these files has been modified. However, changes to the HTML file are picked up while those from the css file are not! The image files are not mentioned.

When I clear the cache as described above and then do a reload, all the image files, along with css file are reloaded fresh. However, the HTML file that was displayed at the time of the reload is denoted as transferred from cache -- again, even though changes are being picked up.

Regardless of what is being reported by the network monitor, it seems as though the target HTML file gets reloaded when changed, but none of the linked files (images or css) get updated, regardless of whether they have changed.

As one final test I should have done before, I loaded my HTML page into Opera, changed the css file and did a reload. The changes were immediately seen.

I'd really like to find a solution for this because it is making editing the css file a royal pain, although I'll switch to Opera for editing in the short term.

Prior to reporting this problem, on a Mozilla forum I reported another anomaly that is probably related to this one. In the past, when I cleared my cache, all my web links that showed "visited" status were reset to unvisited. However, this no longer happens. To reset these links, you now have to clear the Browsing and Download History. It appears that some fundamental change has recently been made to the way caching is handled.

more options

I can't think of any settings that override Ctrl+Shift+r. That makes me suspect some corruption in the program directory (as opposed to the profile folder), but this is based on how Firefox works on Windows. I don't know how program files work on Linux.

more options

Files that are loaded via other (CSS or JavaScript) files might not be reloaded from the server, but possible taken from the cache.

more options

Ctrl+Shift+R should be reloading everything from source, not cache. It is doing this for the target HTML file only, not for any of the internal links. We see this because not only is the css file not being reloaded, neither are the images in my example.

Modifié le par cjsmall