title: Enable Text Compression for a URL without file extension .htaccess
body: <p>I am trying to solve the "<strong>Enable Text Compression</strong>" opportunity on the new Lighthouse page speed audits and am wondering how to enable <strong>text compression</strong> for a <strong>url</strong> like below:</p>
  
  <pre><code>www.magento2.com/customer/section/load?sections=&amp;update_sectionid=false&amp;_=12345678
  </code></pre>
  
  <p>I'm hoping there is a way to do this with <code>.htaccess</code> however there is no <code>.txt</code> appended so am unsure how I can apply to this controller that is generating a <strong>JSON</strong> response.</p>
  
  <p>I've tried adding to my gzip configuration:</p>
  
  <pre><code>mod_gzip_item_include mime ^application/json.*
  </code></pre>
  
  <p>However above does not seem to work.</p>
  
  <p>I have also tried adding below to my <code>VHOST</code> in order to try and force the type:</p>
  
  <pre><code>&lt;Location "/customer/section"&gt;
    ForceType application/json
  &lt;/Location&gt;
  </code></pre>
  
  <p>This however is not seeming to kick the compression into action. The response headers do show <code>content-type: application/json</code> so feel that Gzip should recognise this as a type of response that should be compressed.</p>
  
  <p>My current gzip compression is set as below within <code>.htaccess</code>:</p>
  
  <pre><code>&lt;ifModule mod_gzip.c&gt;
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_include mime ^application/json.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  &lt;/ifModule&gt;
  </code></pre>
  
  <p>Where i have tried to enable by type however would like some other ideas on how this could be achieved?</p>