How to enable compression with mod_deflate

Manolo asked:

Page speed insights tells me to enable compression for google-maps source.
It recommends to use mod_deflate if using Apache.
Well, I’ve put the next snippet code inside the .htaccess file:

<IfModule mod_deflate.c>
<IfModule mod_headers.c>
    Header append Vary User-Agent env=!dont-vary
<IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
    # DEFLATE by extension
    AddOutputFilter DEFLATE js css htm html xml

I’ve enabled mod_deflate (and automatically enables mod_filter), and mod_headers and mod_mime were already enabled..
But Page speed page still tells me to enable compression. What am I doing wrong, or what should I do?

This is a screen shot of page speed error:

Page speed's screen shot

My answer:

Those are third party resources, and you have no control over whether they use compression or not (they will not, because doing so would potentially expose private data in a BREACH or CRIME attack). You can safely ignore messages suggesting compression of resources loaded from third party sites, and messages suggesting compression of content served via HTTPS.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.