List of free web storage providers. Save up to 50 GB online.
Free HTML code reduction (.asp)
The basic idea of this script is to remove useless information from
your HTML pages, so that they may be transfer to your client faster (and
you will also contribute to reduce wasting a bit of energy).
This 1.0 version will only remove redundant spaces. Very often, HTML
editors will include in the HTML code a huge number of useless spaces (sometimes
up to 25% of file´s size). This script will remove them.
<%
if request.form("username")="myusername"
AND request.form("password")="mypassword"
then
FolderName = request.form("FolderName")
response.write ("<BR><b>Code Reduction: pages which
has been reduced</b><BR>")
FolderToCheck = "e:\mydir1\mydir2\"
& FolderName & "\"
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(FolderToCheck)
Set fc = f.Files
For Each f1 in fc
Wfile
= f1.name
if right(Wfile, 4)=".htm" OR right(Wfile, 5)=".html" then
Wfile2 = FolderToCheck & Wfile
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Wfile2)
ct = a.ReadAll
bytesct=len(ct)
a.close
Do While instr(ct," ")>0
ct=replace(ct," "," ")
Loop
bytesct2=len(ct)
Set a = fs.CreateTextFile(Wfile2,TRUE)
a.write(ct)
a.close
response.write (Wfile2 & ": " & bytesct2
& " bytes (" & bytesct & " before code reduction)<BR>")
end if
For security porpouses, this scrips will ask you for a username ("myusername")
and password ("mypassword"),
so you will need to introduce your username and password to use this scripts.
In order to customized this script you will need to introduce the path
to your main directory ("e:\mydir1\mydir2\").
When running this script, it will be request to you the username, password
and the directory in which you want to reduce the code of your ".htm" and
".html" pages. Those data will be request with a form like the one bellow
(this one is not functional).
NOTE: Your server may not allow you to open, read, and create new files
in your site (this option may not be allowed or may be allowed only
in some specific directories).