JavaScriptCompressor
ist nicht fadensicher und sollte nach dem Gebrauch nachgebildet werden (es speichert den Zustand). CssCompressor
lagert keinen Staat.
JavaScript Compressor, CSSCompressor und Multi Threading
-
29-07-2022 - |
Frage
Ich benutze eine statische Klasse, um die zu wickeln Yahoo Yui Compressor:
public static class Minifier
{
private static readonly ICompressor javaScriptCompressor =
new JavaScriptCompressor()
{
CompressionType = CompressionType.Standard,
IgnoreEval = true,
ObfuscateJavascript = true,
PreserveAllSemicolons = true
};
private static readonly ICompressor cssCompressor = new CssCompressor()
{
CompressionType = CompressionType.Standard,
RemoveComments = true
};
public static string GetCompressedCss(string data)
{
//aaaand... action
return cssCompressor.Compress(data);
}
}
Ich habe mich gefragt, ob die Kompressorklassen Thread gespeichert sind.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow