Closed ericfelipe99 closed 5 years ago
there's a solution for zgip compress the bundle ?
No. Use a GZip-compression at IIS level.
I set up dynamic compress on web.config, with all javascript mime-types but it's not compressed anyway.
Do static compression work correctly?
there's a solution for zgip compress the bundle ?
No. Use a GZip-compression at IIS level.
I set up dynamic compress on web.config, with all javascript mime-types but it's not compressed anyway.
Do static compression work correctly?
thanks for your reply.
At IIS level not working to me. I enabled dynamic and static compression, but none of them worked.
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
I enabled dynamic and static compression, but none of them worked.
Are other types of content compressed by GZip (e.g. text/css
or text/xml
)?
I enabled dynamic and static compression, but none of them worked.
Are other types of content compressed by GZip (e.g.
text/css
ortext/xml
)?
yes. i use a site to test: https://developers.google.com/speed/pagespeed/insights/ I working at otimize site (segurofacil.com.br).
all html and css are compressed. I use bundle transformer for compile scss and minify css.... but with css works fine.
maybe something is blocking this compression? or the mime type or extension was not recognized by iis as script?
Сontent of the scriptsbase
bundle was not processed by the Bundle Transformer, because there are no regions:
//#region URL: ….js
…
//#endregion
The sfstyles
bundle successfully passed such processing.
In your Web.config
file has the combineFilesBeforeMinification
setting?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
…
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
<core …>
…
<js … combineFilesBeforeMinification="true">
…
</js>
…
</core>
…
</bundleTransformer>
…
</configuration>
In your
Web.config
file has thecombineFilesBeforeMinification
setting?<?xml version="1.0" encoding="utf-8"?> <configuration> … <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <core …> … <js … combineFilesBeforeMinification="true"> … </js> … </core> … </bundleTransformer> … </configuration>
All my configurations are in bundleconfig.cs file.
BundleTable.EnableOptimizations = true;
BundleResolver.Current = new BundleTransformer.Core.Resolvers.CustomBundleResolver();
bundles.UseCdn = true;
var yuiCss = new BundleTransformer.Yui.Minifiers.YuiCssMinifier();
var ajaxMinifierJS = new BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxJsMinifier();
ajaxMinifierJS.PreserveImportantComments = true;
ajaxMinifierJS.StripDebugStatements = true;
var nullBuilder = new NullBuilder();
var nullOrderer = new NullOrderer();
var cssUrlTransform = new BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor();
var postTransforms = new List<BundleTransformer.Core.PostProcessors.IPostProcessor>();
postTransforms.Add(cssUrlTransform);
/*styles*/
var styleTransformer = new StyleTransformer(yuiCss, postTransforms);
styleTransformer.CombineFilesBeforeMinification = false;
/*script*/
ScriptTransformer scriptTransformer = new ScriptTransformer(ajaxMinifierJS);
scriptTransformer.EnableTracing = false; // remove o nome dos arquivos do arquivo final compilado
scriptTransformer.CombineFilesBeforeMinification = true;
...
// scripts base, jquery, boostrap,
var scriptsBase = new ScriptBundle("~/scripts/scriptsbase");
scriptsBase.Include("........ ");
scriptsBase.Builder = nullBuilder;
scriptsBase.Transforms.Add(scriptTransformer);
scriptsBase.Orderer = nullOrderer;
bundles.Add(scriptsBase);
Replace this line:
var scriptsBase = new ScriptBundle("~/scripts/scriptsbase");
With the following line:
var scriptsBase = new Bundle("~/scripts/scriptsbase");
The StyleBundle
is also replace by Bundle
.
Replace this line:
var scriptsBase = new ScriptBundle("~/scripts/scriptsbase");
With the following line:
var scriptsBase = new Bundle("~/scripts/scriptsbase");
The
StyleBundle
is also replace byBundle
.
Hi, tanks for reply. I changed but it not worked... maybe this is a problem of IIS 7.5 or something else... It's compress css like a charm... i think its a problem with something else...
I changed but it not worked...
In any case, this fix will speed up performance.
maybe this is a problem of IIS 7.5 or something else...
If static JS files are not compressed, then it is most likely a problem at IIS level.
I set up dynamic compress on web.config, with all javascript mime-types but it's not compressed anyway. there's a solution for zgip compress the bundle ? Or use the automatic iis dynamic compress for that?
thanks.