I was wondering around the internet (As you do) when I came across http://ag2.avidgamers.com, which has exceptionally small page sizes. I even copied the code (View-source) and uploaded it to my server, and the diference was 3-4 times the size.
I was wondering how they were able to get their file sizes so small, and if I could do the same.
Thanks,
someberry.
How to reduce file size.
Moderator: General Moderators
-
Bennettman
- Forum Contributor
- Posts: 130
- Joined: Sat Jun 15, 2002 3:58 pm
They basically use a lot of CSS in external pages to make the layout work, so that the HTML in the page doesn't have to (and they can concentrate on the content). External CSS only has to be loaded once, and it obviously results in smaller main pages.
Nothing to do with PHP, but meh.
Code: Select all
<style type="e;text/css"e;>
<!--
@import 'layout.css'; /* two import statements to work */
@im\port "e;layout.css"e;; /* around problems with IE on mac */
-->
</style>-
Bennettman
- Forum Contributor
- Posts: 130
- Joined: Sat Jun 15, 2002 3:58 pm
Ah, I see what you're getting at.
I'd assume that they have page compression (such as mod_gzip) enabled on the server. As I understand it, the pages are the regular size on the server, but they're compressed by Apache before being sent out to the browser.
I don't have a clue about how to go about enabling it though.
I'd assume that they have page compression (such as mod_gzip) enabled on the server. As I understand it, the pages are the regular size on the server, but they're compressed by Apache before being sent out to the browser.
I don't have a clue about how to go about enabling it though.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
I think the output buffering functions let you do that.
http://us2.php.net/manual/en/ref.outcontrol.php
http://us2.php.net/manual/en/function.ob-start.php
http://us2.php.net/manual/en/function.ob-gzhandler.php
http://us2.php.net/manual/en/ref.outcontrol.php
http://us2.php.net/manual/en/function.ob-start.php
http://us2.php.net/manual/en/function.ob-gzhandler.php