# Temporary fix for pkgdb performance issue.  Fix for pkgdb #206

RewriteEngine On
RewriteCond %{QUERY_STRING} tg_paginate_limit=0
RewriteRule ^/pkgdb/builds/name/\* /pkgdb/builds/name/*?tg_paginate_limit=50 [R]

RequestHeader set X-Scheme https early


<Location {{localpath}}>
RequestHeader set CP-Location {{localpath}}

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
</Location>

<Location /pkgdb/static>
    ExpiresActive On
    ExpiresDefault "access plus 5 days"
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
</Location>

<Location /pkgdb/tg_js>
    ExpiresActive On
    ExpiresDefault "access plus 5 days"
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
</Location>

<Location /pkgdb/appicon>
    ExpiresActive On
    ExpiresDefault "access plus 5 days"
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
</Location>

<Location ~ {{localpath}}/(static|tg_js)>
Header unset Set-Cookie
</Location>

ProxyPass {{localpath}} {{proxyurl}}{{remotepath}}
ProxyPassReverse {{localpath}} {{proxyurl}}{{remotepath}}
