JanneJalkanen suggests that web developers should use YSlow for Firebug to develop fast web applications.
to develop fast web applications
I did that, and changed my htdocs/.htaccess file as follows:
ExpiresActive On ExpiresDefault "access plus 1 hours" ExpiresByType image/png "access plus 3 days" ExpiresByType image/jpeg "access plus 3 days" ExpiresByType text/css "access plus 3 days" FileETag none
My cgi-bin/.htaccess file remains unchanged. I think Oddmuse:Caching works just fine.
Looking at one of my pages I now get a score of **A (91)**. I’m not going to use a CDN just yet. 😄
I’m also not going to gzip my HTML output, because I spent too much time making sure that Oddmuse HTML can be served in chunks – compressing it would undo that benefit as I’d have to prepare the gzipped content on the server first, send the header specifying the content length, and then start sending it. For a search, this would mean waiting for Oddmuse to find the last match before starting to send an answer. This needs some more thought.
#Oddmuse #Wikis #Web
(Please contact me if you want to remove your comment.)
⁂
Doesn’t gzip allow compression on the fly? Or maybe the content-lenght is mandatory when compressing?
You could compress only some pages – for example the ones served ’raw’, like images and stylesheets. Then again, I suppose it’s easier to just make them static...
– RadomirDopieralski 2008-11-11 14:52 UTC
---
Yeah, plus images are already compressed.
I *thought* the content length was mandatory – but now that I think about it, I’m not sure. I’ll check when I’m back.
– Alex Schroeder 2008-11-14 00:36 UTC
---
I was confused by all the stuff I had added. I commented the entires section again. I really want to make sure I understand what’s going on. At the moment, my setup added two cache control headers and prevented Etags from working. What a mess.
Before:
alex@kallobombus:~$ curl -I https://alexschroeder.ch/wiki/2015-03-10_Fighting_Wiki_Spam HTTP/1.1 200 OK Date: Tue, 10 Mar 2015 15:33:51 GMT Server: Apache Cache-control: max-age=10 Cache-Control: max-age=3600 Expires: Tue, 10 Mar 2015 16:33:51 GMT Content-Type: text/html; charset=utf-8
Then I commented all the crap in my `.htaccess`:
1. ExpiresActive On 1. ExpiresDefault "access plus 1 hours" 1. ExpiresByType image/png "access plus 3 days" 1. ExpiresByType image/jpeg "access plus 3 days" 1. ExpiresByType image/svg+xml "access plus 3 days" 1. ExpiresByType text/css "access plus 3 days" 1. FileETag none
And tried again:
alex@kallobombus:~$ curl -I https://alexschroeder.ch/wiki/2015-03-10_Fighting_Wiki_Spam HTTP/1.1 200 OK Date: Tue, 10 Mar 2015 15:36:47 GMT Server: Apache Etag: 1425980395 Cache-control: max-age=10 Content-Type: text/html; charset=utf-8 alex@kallobombus:~$ curl -I https://alexschroeder.ch/pics/alex-and-beard-80x80.jpg HTTP/1.1 200 OK Date: Tue, 10 Mar 2015 15:36:41 GMT Server: Apache Last-Modified: Wed, 07 Mar 2012 17:59:57 GMT ETag: "262871-ce4-4baaaed670140" Accept-Ranges: bytes Content-Length: 3300 Content-Type: image/jpeg
I think this is much better!
– Alex Schroeder 2015-03-10 15:43 UTC