On Jul 22, 2009, at 9:21 AM, Steve Alex wrote:
...Any ideas on what we have screwed up?
Again this is random, but frequent. Sometimes a page will load,
sometime one reload will work, other times you need 3 or 4. I'm just
glad that it is not showing up on production, but the mime errors
are there - sometimes! The empty pages also show up in FireFox.
After about 10 days of having these errors/warnings gnawing at me,
I've found the problem on at least one site - it is Safari - but
caused by me. Could you believe a missing gif could cause all these
problems?
Short version:
I thought I had cleaned up all serving from the layouts folder, but
I guess I missed the css files. I fixed the css and after a force
reload or two - no more mime warnings!
Safari 4's caching is seriously broken. A force reload does not
always clear the cache. Either hold down the shift key and select
View->Reload, or select Safari->Empty Cache, then refresh.
I had a couple image URLs in my css file that pointed to a non-
existent folder (the old layouts directory). Safari seems to have a
serious bug that ties a resource not found response to a different
resource, e,g, index.a4d would occasionally display a blank page
because Safari thinks it's displaying a missing gif! It's not enough
to just validate CSS and HTML, you also have to look at FireBug or Web
Inspector!
----------------
A little longer version for those interested. (I wish I could write -
but I can't. I actually own that url <http://iwishicouldwrite.com>
but gave up on trying to put up a Blog and it points a RoR site I
wrote for my golf group. I guess I'm not into the social stuff, but
you can actually find out a little about me at that site or its master
site golfgaggle.com - another unfinished project! I can write some
crappy code - but it is still better than my English. My excuse is
that I'm from Pittsburgh PA!)
For those of you that think css is awesome <http://www.zazzle.com/css_is_awesome_mug-168716435071981928
>, I applaud your skills. Every time I think I understand css I'm
beaten down by trying to add some neat effect that I copied and pasted
into my css that does not work or looks the same. I understand
styling, but cascading/inheritance is my downfall. I decided to try to
cleanup my css and get rid of 9 of the 10 different approaches I tried
to get some effect (e.g., horizontal nav bar). Since I've retired and
have nothing to do except work on my money-pit retirement house, I
decided to see if I could rewrite one of the sites from scratch at the
same time!
I started with something called Compass and Sass <http://compass-style.org/
> to fix the style sheets - a really neat programing concept. One of
the things that Sass points out is that css was designed to make
browsers more efficient, not designers. Sass is an attempt to make
designers more efficient (but generates slightly inefficient css).
Skipping forward - I started with the basic parts of my css (the 1 out
of 10 approaches I liked) and converted it to sass. Everything worked
great with only some minor tweaking - but I still saw the mime
warnings. I then tried to rewrite a couple of the circuits from
scratch using a circuit generation tool I wrote in Active4D - kind of
a RoR script/generate approach. I've been playing with that tool for
the last couple of years and will share it if I ever decide that it is
actually useful. Again, that worked great and I had consistent pages -
but I still saw the mime warnings. Trying to tweak my generation tool
to handle nested fuses better, I put some debugging code in an Ajax
handler to dump something from $fusebox. Of course the Ajax handler
did not have $fusebox available and I got a syntax error. I moved the
dump, but then started getting random syntax error messages pointing
to code that was no longer there. It was time to go to the mountain
and ask the Guru for guidance - Aparajita. How could Safari be caching
an error page on code that was no longer there?
As usual, after a couple brief exchanges, he pointed me in the right
direction and made me see the light! A couple years ago I finally got
around to moving static content from the layouts directory to the
web_static folder. The problem was that I left the css, image and js
directories in the layouts folder - just in case I missed one. The
rewrite version of the site did not have a layouts directory and no
static content should have been served by Active4D. When asked to
double check that static content was indeed being served by 4D, I took
a closer look at Web Inspectors resource page and saw the missing
reference to /layouts/images/li-arrow.gif. I had used that gif in a
couple different places in the css - one pointing to /images in
web_static and one pointing to the missing layouts directory. That
little error, a missing image, caused Safari to puke.
I have not looked at the development server to see if it has the same
problem, but I now know where to look. Hopefully if you see this
problem crop up, I'll save you some time in looking for the solution.
End long version
Steve Alex
[email protected]
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/