Forum Moderators: phranque

Message Too Old, No Replies

Convert SSI output into html

Suggestions for converting SSI output into html files for later downoad

         

4thePegeh

7:50 am on Mar 11, 2007 (gmt 0)

10+ Year Member




Any efficient ways to convert the files that result from multiple ssi into simple html files to shorten downoad times and reduce resource use?

Currently my pages each make about 12 or more ssi includes to produce the final pages.

I wish to cause that to occur once to produce the final file, then make that completed file available for download (rather than my visitors calling the file that does all of the ssi). In other words, rather than have 12 ssi includes occur every time a visitor downloads file A, I want to download file A and have the 12 includes occur once, then make the finished file A product available for download by visitors.

This way I could still modify the files and site via ssi, but the visitors can download files that don't have to do ssi because the ssi has already been done to create the file they are downloading.

I think I could copy the source of the completed file and paste it into a file, but is there anything more efficient in case i have many pages?

Corey Bryant

3:18 pm on Mar 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would make sure that all your includes are html / txt / inc so they are not parsed. But that is about it. You could do JS includes but that will run to a lot of other problems with search engines and some browsers.

-Corey

mattur

3:33 pm on Mar 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could write a script to read each SSI file (or the same content stored in a database if you prefer) and then compile and save each page. When the "included" content changes simply re-generate the pages with the script.

As you mention, this means the compilation overhead is incurred only when the data changes, rather than on every page view. This is sometimes called "semi-static" publishing.

4thePegeh

6:51 pm on Mar 11, 2007 (gmt 0)

10+ Year Member



Thank you both.

Mattur, what languages are commonly used for such a script?

Yes, Corey, I was able to figure out that technique of using some extenstions to avoid having the included files parsed, and using others when I have nested includes.

[edited by: 4thePegeh at 6:53 pm (utc) on Mar. 11, 2007]

mattur

9:39 am on Mar 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Practically any scripting language is capable of doing this including the popular ones PHP and ASP. The core bits of code you need are reading a file and saving a file, combined with some basic text manipulation.

Alternatively, you could generate the pages offline on your desktop PC using VBscript in WSH (Windows Scripting Host) or in MS Access, and then upload the pages as normal via FTP.

4thePegeh

1:15 pm on Mar 12, 2007 (gmt 0)

10+ Year Member



ok Mattur, Thank you.