Use a CDN for all static assets / pngbehavior.htc

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Use a CDN for all static assets / pngbehavior.htc

Post by seraphyn »

A small Question but this makes me headaches.
I tested my Template with http://www.webpagetest.organd owned 91 Points of 100.
So far, so good, but points me to use a CDN for all static assets and gave me a failed at:
FAILED - http://seraphyn.teiko.org/templates/def ... ghts20.gif
FAILED - http://seraphyn.teiko.org/templates/seraphyn_spring/
blablabla
See the link at the bottom, not more than 4 URLS allowed
Does someone have fixed this issue in a way?

the other thing is, that I got two times the plugin/pngbehavior.htc in this test http://www.webpagetest.org/result/110607_BX_S34W/

Thanks in advance
Chris
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by yellowled »

seraphyn wrote:I tested my Template with http://www.webpagetest.organd owned 91 Points of 100. So far, so good, but points me to use a CDN for all static assets and gave me a failed at:
Okay, first of all -- I don't know this particular test, but in YSlow and PageSpeed, 91/100 would be a pretty good result. :) Second, testing a template in terms of performance is, well, not pointless but misleading. There are many performance factors which are more related to the web server the blog is hosted on than, also you have no idea what plugins people are going to use with the template later "in the wild". A performance test usually reflects the instance of a blog it was run for, but not much more.

That being said, the .htc file is part of the Browser Compatibility plugin. Basically, it's a polyfill for IE6 to display alpha-transparent png files correctly. someright20.gif smells like Creative Commons license plugin. Also, about using a CDN: that's way, way over the top for an average blog. (It's also unaffordable for most bloggers, which is why i.e. YSlow does not recommend it in "small site or blog" mode.)

I can't really say much more without checking it out myself with the tools I'm familiar with, but I'm pretty sure you're good to go. Feel free to point me to a live URL so I can check it out and give you some pointers.

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by seraphyn »

http://seraphyn.teiko.org/
That's it.
But I'm still building throwing things out, sort things here, than i need to clean up the CSS and HTML-Tags etc.
Then this will be the basement for the Template I'll contributing to S9Y.
With slidely other colors and pictures.
Called spring lol, but I think it'll be summer when I release it for s9y LOL
Chris
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by yellowled »

seraphyn wrote:That's it.
YSlow score: 98/100. That's very good. YSlow reports only 2 things:
  • Reduce DNS lookups: Every time a site fetches an asset from a different domain than yours, it needs to do a DNS lookup. My experience: These are hard to get rid of since they usually result from external services like webfont, image and video hosting or stats tools.
  • Make fewer HTTP requests: The blog uses 4 stylesheets and 4 external javascript files. Try to reduce these numbers by combining them. This is sometimes hard since i.e. the webcounter you're using counts as a JS file, but you can't really combine it with the rest of the JS. Also, some plugins (i.e. Lightbox) for s9y add external CSS or JS files. As far as I can see, you can't do much about it here.
Let see what PageSpeed says: 83/100. Also very good. PageSpeed is a little more ridig about the rules it applies, I also still don't get how they actually weigh their rules. Anyway, just 2 "warnings":
  • Apparently, you're not using gzip compression. That's something every user would have to activate on their server anyway, so it's not theme-related.
  • Compress HTML. That's something only PageSpeed reports, i.e. removing comments and spaces from the emitted HTML. You can actually save some bytes by removing unnecessary comments and spaces from you .tpl files, but there's no "automagic" solution for this for s9y. Also makes the source code of the blog pretty much unreadable when view with "View source". I'm not really a fan of this unless a site really runs into performance issues. Even if it ever does, it's (just my humble opinion) pretty unlikely compressing the HMTL will solve much.
  • Remove unused CSS/inefficient CSS rules. Also something PageSpeed is kind of high on, but which is not always easy to implement. For instance, it's very likely the unused CSS rules it reports are simply not used in that particular page, but in other pages of the blog. Also, efficient use of CSS selectors is a topic which is still up for discussion.
So, bottom line: You're good to go as far as I can tell, at least in terms of performance. :)

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by seraphyn »

Thanks :)
Tried to figure everything out.
At the moment I code a little bit on it.
I use deflate on Apache2.
Hetzner at the moment but I would like to go back to all-inkl next year.
My .htaccess looks like this (s9y-interna stripped):

Code: Select all

# html, txt, css, js, json, xml, htc:
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE text/css
<FilesMatch "\.(ttf|otf|eot|svg|css|jpg|png|js|xhtml|html|htm|php|xml)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
#1woche
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=2678400, public"
</FilesMatch>

#1woche
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>

# NEVER CACHE
<FilesMatch "\.(html|htm|php|cgi|pl)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>

That makes me wondering since, 2 months, switched deflate on, switched in s9y-Admin use compression on ( same like at all-inkl before). And every tool tolds me, go on man, use compression *g*

I really dunno if something in my syntax at the .htaccess is wrong, but at home it works nicely. Asked Hetzner if they switched on mod_deflat and they told me, yes, allready at every webspace.
I pay to much for Hetzner ;)

Thanks once again
Chris
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by yellowled »

seraphyn wrote:I use deflate on Apache2.
I am neither an Apache expert nor familiar with the Hetzner setup. Since YSlow does not report missing compression, I guess your setup is okay. It's possible PageSpeed only reports components which can not be compressed for various reasons (i.e. the external JS inserted by 1a-url.de, which is inserted dynamically and can not be compressed as far as I know).

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by seraphyn »

Okay.
I think it is serendipity.css too, cause of on the fly generation.
So I'll ignore it ;)
Thx for the answeres...
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by yellowled »

seraphyn wrote:I think it is serendipity.css too, cause of on the fly generation.
Yes.

YL
LazyBadger
Regular
Posts: 176
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by LazyBadger »

seraphyn wrote: I use deflate on Apache2.
Hetzner at the moment but I would like to go back to all-inkl next year.
My .htaccess looks like this (s9y-interna stripped):
You have add nothing into .htaccess by hand in order to get s9y compression to work. Compare your response headers

Code: Select all

Date: Tue, 07 Jun 2011 18:44:54 GMT
Server: Apache
X-Powered-By: PHP/5.2.16
X-Blog: Serendipity
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Expires: 0
Pragma: no-cache
X-FreeTag-Count: Array
Keep-Alive: timeout=15, max=89
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

200 OK
and obvious result
with my lazy config

Code: Select all

Date: Tue, 07 Jun 2011 18:44:04 GMT
Server: Apache
X-Powered-By: PHP/5.2.12
Status: 200 OK
Expires: 0
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
X-Blog: Serendipity
X-FreeTag-Count: Array
!!! Content-Encoding: gzip  !!!
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
and
result of testing
Quis custodiet ipsos custodes?
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Use a CDN for all static assets / pngbehavior.htc

Post by seraphyn »

That's my problem ;)
Spoken with Hetzner and told so.
Don't know, but the only thing that I really know is, all-inkl was better...

Chris

ps: As I said, this .htaccess works perfect on FreeBSD and Debian. So I don't know wht Hetzner is doin...
Post Reply