简体   繁体   中英

Joomla/FTP: Files updated via ftp won't update in browser

First of all, this has nothing to do with the browsers cache, I'm 100% sure about it.

I really really hope you can help me with that. I'm trying to fix this for more than 10 flat hours now. :/

So I was updating and deleting some files (jpg,css,js and ico) using my ftp account.
After the files were uploaded, I downloaded them again using my ftp account. So, I can confirm the files were uploaded correctly.
But now comes the weird thing: I start a computer (different ip, never visited my website). I cleaned the cache of the browser on the device 2 times just in case...
Then I visit the website and the css/js/jpg/ico files were not updated. Not even if I access them by directly typing their addresses in the addressbar.
Then I tried it on 2 other different devices. No success.
So I went back to my main computer and downloaded the files using my ftp login and yes the files were up2date. I waited more than a day for my favicon to show up correctly. But it's still the original Joomla icon.

Now you might think that I used a wrong ftp account, but I notices something very very weird. When I click show sourcecode in Firefox and then click on the "link" to the css file in the appearing window it shows the old file (as expected..), but after pressing F5 it actually shows the correct one. When I now go back to the browser and type the address of my website again the new css is actually applied. When I reload it anothertime everything goes back to the old one though.

Uploading new files that didn't exist before are no problem at all btw. They are immidiately available.

I guess this has something to do with either my Joomla! (3.1.5) or my hoster (lima-city.de). :/

Edit:
It's getting even better. Some cahnges I must have made maybe 2 days ago did just apply! My site is basically f**ked. -.- I tried to cahnge soooo many things back when I didn'T realize that it wasyn't updating them and I made a lot of mistakes there. And now I can't change it back... I have no idea what the heck is going on there.

I don't think that this is related to the .htaccess. I had these issues before Is I started using it.

Another edit:
It just changed back by itself... I dont like Joomla. -.-

edit again:
About the last edit: It turned out that I was just typing www. instead of http://
oO how is that even possible. Why does different css get applied with "www."?

If you rename your .htaccess do the files download correctly?

It should be a cache issue (the server can put an "expire" time on the files it serves so the browser won't check for modifications; also it can cache files itself). This was done in the .htaccess or in the httpd.conf most likely.

If you can't solve it with .htaccess, without wasting more time, just upload new files under a different name (add version to the name icon-2.png)

Update: The expires headers are located either in .htaccess:

<IfModule mod_expires.c>
ExpiresDefault                          "access plus 1 month"

or in the httpd.conf (which is the main apache configuration, usually hosted by your provider):

LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so
ExpiresActive On

<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 3 days"
</filesMatch>

In order to determine if a long expiration is present, just open Firebug - Net panel, reload the page and you should be able to quickly spot the Cache-Control max-age= Firebug屏幕截图

So if - as I gather from your latest comment - it is present in your httpd.conf, you still should be able to override it in the .htaccess.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM