Friday, July 10th, 2009
So recently I’ve been playing around with GZIP compression on Apache and PHP to see how fast I can get my assets to load. Now I’ve written a post already on how to compress sites with GZIP.
Now I’ve taken my script to a new level, that is the asset loader script that compresses text-based assets using GZIP. I’m not using any sort of code compressor on the assets, yet, as I’ve already compressed the scripts using YUI. More importantly, I’ve now added the ability for me to cache a number of files into one rather than loading several, as we all know: less HTTP request = more fun.
(more…)
Tags: cache, caching, compress, compression, CSS, gzip, JavaScript, PHP, text, XML, zip
Posted in APIs, Actionscript 3, CSS, Development, JavaScript, PHP, XML |
No Comments »
Thursday, May 28th, 2009
Web sites need to be fast! Recently I’ve had some time on my hands so I’ve done some tests to see which is the best solution. I’ve had a read about different ways that web sites can be sped up, from compression before you upload files to server side compression.
Whenever it comes to speeding things up, I always remember the saying that “loading data from a flat file is slow, a database is slower, but memory is the quickest”. So that means if you’ve using server-side scripting such as PHP or Python, the best thing to do is to use memory caching such as APC or MemCache.
(more…)
Tags: apache, apc, caching, compress, compression, compressor, CSS, gzip, htaccess, JavaScript, memcache, PHP, XML
Posted in CSS, Development, JavaScript, PHP, XML |
No Comments »
Thursday, May 21st, 2009
Following my tutorial how to use PureMVC on Flashtuts+, I got a few comments about an error that Flash Debug Player throws when loading an image from Flickr:
SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content: http://flashtuts.s3.amazonaws.com/ 026_PureMVC/App.swf cannot access http://farm3.static.flickr.com/2472/ 3549227972_7e6bd4d79a_t.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::LoaderInfo/get content()
at com.flashtuts.view.component::ImagesView/handleLoaderComplete()
Now there are two ways around this:
- Using a PHP Proxy
This is the sneaky way as you’ll be loading images from Flickr and then putting them on your server. It’s not the best way, but it does have a great  advantage being that because the images are on your server, you won’t have to wait for the Flickr service (as it can get slow) nor will it effect the band width usage on your account.
- Using ‘LoaderContext‘ in AS3
This is the proper way as you’re not putting the images on your server, but there are times when Flickr does get busy and this often causes issues with your Flash file if you haven’t put in the proper ‘try’ and ‘catch’ statements.
(more…)
Tags: Actionscript 3, api, APIs, cache, caching, crossdomain, flickr, loader, loadercontext, policy, proxy, security
Posted in APIs, Actionscript 3, Development, PHP |
1 Comment »