Web Hosting Talk







View Full Version : Speeding up HTML files...


Domenico
11-20-2001, 08:41 PM
This might sound like a stupid question but I will ask it anyway.

Say you run software like Zend Accelerator or one of the other cache software and you rename your .HTML files to .PHP files.

Will this speed up your pages ??? No PHP is used but only HTML.
Are the pages going to be cached anyway or do these programmes only cache and optimize (like advertised) PHP code?

Thank you.

getweb
11-20-2001, 08:58 PM
I think best case you'll slow it down running it through Zend. (Well, same with worst case I guess.)

Doesn't Apache handle caching of static files? I think that is the best place to start looking, anyway. I can't see going through extra hoops make anything faster unless the web server was seriously lacking in caching ability.

If Apache's already caching the pages in memory, there's not a faster way to do it. It's already going straight from memory through the webserver and out the door.

Domenico
11-20-2001, 09:04 PM
I really would like to know if Apache caches HTML and Pictures and where I can config that ...

bitserve
11-21-2001, 01:12 AM
http://httpd.apache.org/docs/mod/mod_mmap_static.html

It's experimental.

http://httpd.apache.org/docs-2.0/mod/mod_file_cache.html

If you're brave enough to be running apache 2.0.

Quill
11-21-2001, 01:34 AM
Why don't you try sitepointforums.com (http://www.sitepointforums.com/)

Domenico
11-21-2001, 06:56 AM
So, it isn't standard and my question is if programmes like Zend Accelerator cache normal HTML and pictures... I can't imagine they only take out the PHP out of the html and html out of PHP so maybe it could work (my first post).

Maybe I should ask Zend about this.

Running Apache 2.0 beta? Are you out of your mind??? :D

eva2000
11-21-2001, 08:27 AM
when you mean speed up html pages, you mean the loading of them ? mod_gzip compresses pages including html pages

i had this text intensive html page 260kb in size be compressed to just 16kb

load time 260kb on dial up would be at least 60 - 70 seconds whereas compressed 16kb would be 4 - 5 seconds!

do a search on the forum for mod_gzip

Domenico
11-21-2001, 01:20 PM
We use mod_gzip and we like it very much.

I asked a ZEND official and he said that everything you want gets cache by Zend Accelerator so I think parsing the normal html files (renaming the .html files to .php or simply use .htaccess) through the php engine it will be cached by Accelerator so that is a good thing I suppose. For sites that have MANY visitors a day this reduces HD access.

What do you guys think? Serving your site completly from cache isn't such a bad thing I guess.

Am I completely wrong here?

phpwebhosting.com
11-22-2001, 03:07 AM
I'd recommend:

use mod_gzip - gzip (and all compression in general) can really reduce the size of raw text. You'll see a boost just by using mod_gzip. Almost all modern browsers support it without any special settings needing to be made.

Second, keep a lot of free ram on your server. Most O.S.'s (or at least linux!) will do a pretty good job keeping the high traffic pages in cache without you really needing to fiddle with it much at all.

The memory mapping module mention above is also a good choice, as is the possiblity of putting the static content on a ram disk but for a lot of uses you'll find that just having free ram will do the trick in most cases. Linux almost always keeps ram utilization at 100% - it may take a half hour or so but pretty quickly your ram will be put to good use caching the high traffic pages.

Greg

purplemokey
11-22-2001, 09:06 PM
I think you are a bit confused. Correct me if I am wrong here.

The reason you cache PHP files is because they are dynamically built when requested. So say you have a PHP file that accesses your database for the latest inventory for your store. Now the catch is that you only update your database at the end of the day so accessing your database everytime is a waste since your page will only change once a day. Therefore you cache that page in html which bypasses your database and makes your server happy and fast.

Since you are not using PHP and just HTML then caching it will not speed up your pages. However, as someone else suggested installing gzip will speed up your site because it compresses your HTML file and then sends that to the browser. So instead of sending an 80K HTML file then it could be only 70K which doesn't see that much but you just saved 12.5% on your bandwidth and the browser only had to download 70K instead of 80K.





Originally posted by Domenico
This might sound like a stupid question but I will ask it anyway.

Say you run software like Zend Accelerator or one of the other cache software and you rename your .HTML files to .PHP files.

Will this speed up your pages ??? No PHP is used but only HTML.
Are the pages going to be cached anyway or do these programmes only cache and optimize (like advertised) PHP code?

Thank you.

madmatty
11-22-2001, 09:37 PM
Yes I'm pretty sure that the way Zend works is that it caches the output of the php after it has been parsed by the php engine. So wouldnt do a thing for raw text.

purplemokey
11-23-2001, 01:52 PM
Originally posted by madmatty
Yes I'm pretty sure that the way Zend works is that it caches the output of the php after it has been parsed by the php engine. So wouldnt do a thing for raw text.

Thanks madmatty I thought I was alone on this :)

Domenico
11-24-2001, 02:51 PM
Ok, I allready understand that and I used the wrong words in my question but the page would still be cached from memory instead of HD so the server load would drop.

Don't you think so?