I have xsl file whose size is approx 12kb, i want to zip it.
Is there any way to zip xsl file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/page1">
<form name="form1" style="margin:0px;padding:0px" action="action.php" method="post" onsubmit="return checkData();">
<xsl:variable name="name" select="op1 />
<xsl:variable name="name" select="op2 />
</form>
</xsl:template>
</xsl:stylesheet>
This depends on your server. On Apache, you need to activate mod_gzip in your httpd.conf file. Googling for mod_gzip will provide plenty of guides on enabling it.
If you cannot edit your root Apache configuration, there are two alternatives. If the XML file is static, compress it manually, name the file foo.xsl.gz and if not already active, turn on
MultiViewsin the.htaccessfile for that directory. If the XML file is not static, or if you cannot even use .htaccess, the last resort is to change the XML file to a PHP script, and wrap your ob_* commands around the code to spit out the XML.