Figured out the problem

18 views
Skip to first unread message

at

unread,
Feb 4, 2012, 9:09:42 PM2/4/12
to framework-one
Hi

The problem ended up being very silly but with lots of headaches.

I had an inline style sheet including a background image that was
causing the application.cfc to be executed twice.


#footer {
height: 84px;
//background: url(images/footer.png);
}

thanks,

anthony

Sean Corfield

unread,
Feb 8, 2012, 4:56:04 PM2/8/12
to framew...@googlegroups.com
I recommend adding a web server rewrite rule that causes static assets
to be handled directly by the web server instead of passing them to
the app server, something like this (for Apache):

RewriteRule ^.*\.(bmp|gif|htc|html?|jpe?g|ico|png|css|js|txt|pdf|doc|xls|xml)$
- [L]

Sean

> --
> FW/1 on RIAForge: http://fw1.riaforge.org/
>
> FW/1 on github: http://github.com/seancorfield/fw1
>
> FW/1 on Google Groups: http://groups.google.com/group/framework-one

--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

ehm77

unread,
Feb 9, 2012, 10:10:50 AM2/9/12
to framework-one
We had a similar issue, but took a slightly different approach:

# exclude files from rewriting
RewriteCond %{REQUEST_FILENAME} !-f
# exclude directories from rewriting
RewriteCond %{REQUEST_FILENAME} !-d
# exclude static files, they should throw a 404 if they do not exist
RewriteCond %{REQUEST_URI} !^.*\.(css|js|jpg|gif|png|swf|ico)

# rewrite rules, NS skips rewrite rule for internal sub-requests
# for fw/1
RewriteRule ^(.*)$ /index.cfm/$1 [NS,L]

Basically the same idea, slightly different implementation. Is there
any benefit to using RewriteRule over RewriteCond to exclude the
static files?

On Feb 8, 4:56 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> I recommend adding a web server rewrite rule that causes static assets
> to be handled directly by the web server instead of passing them to
> the app server, something like this (for Apache):
>
> RewriteRule ^.*\.(bmp|gif|htc|html?|jpe?g|ico|png|css|js|txt|pdf|doc|xls|xml)$
> - [L]
>
> Sean
>
>
>
>
>
>
>
>
>
> On Sat, Feb 4, 2012 at 6:09 PM, at <ocon...@gmail.com> wrote:
> > Hi
>
> > The problem ended up being very silly but with lots of headaches.
>
> > I had an inline style sheet including a background image that was
> > causing the application.cfc to be executed twice.
>
> >                #footer {
> >                        height: 84px;
> >                        //background: url(images/footer.png);
> >                }
>
> > thanks,
>
> > anthony
>
> > --
> > FW/1 on RIAForge:http://fw1.riaforge.org/
>
> > FW/1 on github:http://github.com/seancorfield/fw1
>
> > FW/1 on Google Groups:http://groups.google.com/group/framework-one
>
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View --http://corfield.org/
> World Singles, LLC. --http://worldsingles.com/
Reply all
Reply to author
Forward
0 new messages