如何配置mod_gzip以排除除少数mime类型之外的所有mime类型?

时间:2018-04-19 15:43:52

标签: regex gzip mime-types http-compression

我需要配置public class LoginActivity extends AppCompatActivity { private TextView ForgetPass; private Button Login,Signup; private EditText UserName,Password; onCreate { Login = (Button)findViewById(R.id.login); Signup = (Button)findViewById(R.id.signup); ForgetPass = (TextView)findViewById(R.id.forgetPass); UserName = (EditText)findViewById(R.id.userName); Password = (EditText)findViewById(R.id.password); helper = new DatabaseHelper(this); Signup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent1 = new Intent(LoginActivity.this,SignUpActivity.class); startActivity(intent1); } }); } } 文件以使用.htaccess启用HTTP响应压缩。我可以让基本压缩工作。

但是,我希望对所有MIME类型禁用压缩,以下内容:

  • 文本/ *
  • 消息/ *
  • 应用程序/ x-JavaScript的
  • 应用/ JSON
  • 应用/原子+ xml的
  • 应用/ XAML + xml的

我知道我可以使用诸如mod_gzip之类的语句来包含或排除或排除某些mime类型,但我似乎无法正确使用它。我应该如何配置我的mod_gzip_item_exclude mime ^regex$文件?

1 个答案:

答案 0 :(得分:1)

看看是否有效:

^(?:(?:(?:text|message)\/\*)|(?:application\/(?:x-javascript|json|(?:atom|xaml)\+xml)))$