JavaScript caching

Nao

  • Dadman with a boy
  • Posts: 16,082
JavaScript caching
« on May 10th, 2011, 06:43 PM »
Feature: JavaScript caching
Developer: Nao
Target: everyone
Status: 100% (believed to be complete.)
Comment:

Right after minifying your CSS and JS files, Wedge will cache them and gzip them. The good point is that it's smart enough to cache multiple files together, relieving the server a bit.

I'll use my script.js example again. At the time of writing, the regular script.js/theme.js duo is about 50KB in SMF2 (split over two files), less than 30KB in Wedge (with many extra functions in them), and the actual stuff you download is a single 6KB file, after minification and gzipping. Meanwhile in the wasteland, SMF2 still sends you 50KB of data. Because everyone knows all end-users absolutely need to have comments in the JavaScript code they execute.

Re: JavaScript caching
« Reply #31, on July 16th, 2011, 10:10 AM »
This particular problem is fixed now because I didn't actually need to include menu.gif again because it was already registered as the background for h4 tags (a slight oversight.)
I'm still of the opinion that micro-optimizations aren't a waste of time, more like a way to train oneself to determine what's important to optimize, and what's not.

I don't really know what can't handle gzip, honestly, but I'm sure there are clients that can handle gzip content, but can't handle files with a gz extension. I mean, Safari itself doesn't, I had to do this annoying htaccess/MIME trick for it. (Uh.)