Strange cache behaviour after upgrade
Permalink
I have just upgraded a website to 5.4.0.3 and noticed the css was all haywire. Just odd things like margins askew type the wrong color etc.
I turned the cache off completely and it fixed it.
So I emptied the cache and turned the cache back on. The css is blown out again.
So cache enabled css blow out.
Cache disabled css is fine.
I've currently turned the cache off but I would like to turn it on.
Any ideas?
Nige
I turned the cache off completely and it fixed it.
So I emptied the cache and turned the cache back on. The css is blown out again.
So cache enabled css blow out.
Cache disabled css is fine.
I've currently turned the cache off but I would like to turn it on.
Any ideas?
Nige
did cache_objects get cleared as well? what are the differences in the html thats generated with caching on and off?
Sorry other side of the world, been asleep.
Thanks for helping.
How can I tell if cache objects are cleared?
I can only compare the top part of the html on a screen shot of the source and nothing seems different except I found this line is cache off –
<script type="text/javascript" src="/tools/required/page_controls_menu_js?cID=1&cvID=&btask=&ts=1271793813"></script>
and this line is cache on:– <script type="text/javascript" src="/tools/required/page_controls_menu_js?cID=1&cvID=&btask=&ts=1271794099"></script>
...ts= number is different...
Nige
Thanks for helping.
How can I tell if cache objects are cleared?
I can only compare the top part of the html on a screen shot of the source and nothing seems different except I found this line is cache off –
<script type="text/javascript" src="/tools/required/page_controls_menu_js?cID=1&cvID=&btask=&ts=1271793813"></script>
and this line is cache on:– <script type="text/javascript" src="/tools/required/page_controls_menu_js?cID=1&cvID=&btask=&ts=1271794099"></script>
...ts= number is different...
Nige
Delete everything in files/cache and files/cache_objects.
OK thanks I will give that a go
and it has made no difference...
It's weird just enabling the cache it changes instantly...
could it be the database?
Nige
It's weird just enabling the cache it changes instantly...
could it be the database?
Nige
You need to find out what the difference is between cache and no cache. Guessing won't help determine a solution. There is a difference for a reason.
If the source looks the same between cache and no cache, then you need to compare the css between cache and no cache. Something like Firebug in Firefox would make that easier.
Make sure you clear the browser cache before each test. You might try a different browser, especially if you have something in css that is customized to different versions of a browser.
If the source looks the same between cache and no cache, then you need to compare the css between cache and no cache. Something like Firebug in Firefox would make that easier.
Make sure you clear the browser cache before each test. You might try a different browser, especially if you have something in css that is customized to different versions of a browser.
OK I will give all that a go, I didn't realise the css could change on the fly just by enabling the cache.
Of course the site is live and for a client so it's difficult to test during the day (which it now is here)
I will try and be discrete.
All my other sites upgraded very well, its just this one. There are differences between how the sites are composed.
The troublesome one has a tagged head for instance and the html declaration version at the top.
A lot of my other sites don't. I have played around with this and it does make some differences.
But I will methodically go through and troubleshoot this until I find the solution and post here if anyone else has a similar difficulty.
Thanks for your advice.
Nige
Of course the site is live and for a client so it's difficult to test during the day (which it now is here)
I will try and be discrete.
All my other sites upgraded very well, its just this one. There are differences between how the sites are composed.
The troublesome one has a tagged head for instance and the html declaration version at the top.
A lot of my other sites don't. I have played around with this and it does make some differences.
But I will methodically go through and troubleshoot this until I find the solution and post here if anyone else has a similar difficulty.
Thanks for your advice.
Nige
CSS shouldn't change on the fly. However, C5 does allow customization, which will affect the CSS. That's why it would be good to compare the cache css with no cache css. That should tell you how it is different.
It is a mystery why turning on the cache would have an effect. C5 does cache some css, but that shouldn't change the css. Either there is something funny with cache, or there is something odd with the css that only shows up when caching is turned on.
If you have multiple C5 websites running on the same web server, they cannot use APC for cache unless you apply the CACHE_ID modification discussed in another thread. The web server can use APC, but C5 cannot, because the C5 instances use each other's cached information.
It is a mystery why turning on the cache would have an effect. C5 does cache some css, but that shouldn't change the css. Either there is something funny with cache, or there is something odd with the css that only shows up when caching is turned on.
If you have multiple C5 websites running on the same web server, they cannot use APC for cache unless you apply the CACHE_ID modification discussed in another thread. The web server can use APC, but C5 cannot, because the C5 instances use each other's cached information.
Mmmm I do have multiple C5 sites running on the server and this is the only troublesome one.
The css I have written is being interfered with when I turn caching on. It's probably worth remembering that it wasn't an issue before the upgrade. The cache was on and the css was fine.
It's since the upgrade.
So. css fine - Then upgrade - css odd - turn cache off - css fine.
Deleting all the cache files and objects didn't help either.
How can you compare cache css with no cache css? With html you can view the source. I mean I can open the css files but they don't get written too at anytime do they?
Nige
The css I have written is being interfered with when I turn caching on. It's probably worth remembering that it wasn't an issue before the upgrade. The cache was on and the css was fine.
It's since the upgrade.
So. css fine - Then upgrade - css odd - turn cache off - css fine.
Deleting all the cache files and objects didn't help either.
How can you compare cache css with no cache css? With html you can view the source. I mean I can open the css files but they don't get written too at anytime do they?
Nige
There's only a problem if two or more C5 websites are using APC on the same server. If you aren't using APC, then the cause of the problem is something else.
To check the css, you would need to use a tool like Firebug with Firefox. You can also use Web Developer in Firefox to view the css on a web page.
To check the css, you would need to use a tool like Firebug with Firefox. You can also use Web Developer in Firefox to view the css on a web page.
Oh yes thank you, you said that earlier. Cheers for the advice.