Severity: Warning
Message: Undefined variable $page
Filename: front/Articles.php
Line Number: 91
Backtrace:
File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 91
Function: _error_handler
File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once
Severity: Warning
Message: Undefined variable $pages
Filename: front/Articles.php
Line Number: 110
Backtrace:
File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 110
Function: _error_handler
File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once
Severity: Warning
Message: Undefined variable $page
Filename: front/Articles.php
Line Number: 111
Backtrace:
File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 111
Function: _error_handler
File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once
Severity: Warning
Message: Undefined variable $category
Filename: front/Articles.php
Line Number: 113
Backtrace:
File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 113
Function: _error_handler
File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once
Severity: Warning
Message: Undefined variable $articles
Filename: front/Articles.php
Line Number: 114
Backtrace:
File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 114
Function: _error_handler
File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once
Accept-Encoding: gzip header along with their request. This basically tells our server that everything is going a-ok and we can feel free to fire some gzipped content down the line.
Content-Encoding: gzip header. The file that the server sends back is significantly smaller than the original file so it arrives (and is processed by the client) in a fraction of the time that the original would have taken. The client decompresses the file back to its original form and displays or loads it.
compress_static.pl.
use strict;
sub compress
{
my ($dir) = @_;
opendir(DIR, $dir);
foreach (readdir(DIR))
{
my $file = $dir."/".$_;
if (-d $file && $_ !~ /^\.$|^\.\.$/)
{
compress($file);
}
elsif ($file =~ /\.(js|css)$/)
{
`gzip -c $file > $file.gz`;
}
}
closedir(DIR);
}
compress('/path/to/my/css/files');
compress('/path/to/my/js/files');
(js|css) (.js or .css) files and if it finds one, it gzips it up and outputs it to the filename.gz.
perl ./compress_static.pl, check your CSS and JavaScript directories and you'll see that you now have 1 .gz file for every .js or .css file in the directory. This is your compressed content and it's now ready to be served to your website visitors.
AddEncoding gzip .gz
<FilesMatch .*\.js\.gz$>
ForceType text/javascript
</FilesMatch>
<FilesMatch .*\.js\.css$>
ForceType text/css
</FilesMatch>
RewriteCond %{HTTP:Accept-Encoding} (gzip.*)
RewriteCond %{HTTP:HTTP_USER_AGENT} !Safari
RewriteCond %{REQUEST_FILENAME} !^.+\.gz$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.+) $1.gz
RewriteCond %{REQUEST_FILENAME} !^.+\.gz$ says, don't serve compressed content of this file if this is a request for a file which has a .gz extension already, i.e. don't get stuck requesting myfile.gz.gz.gz.gz &c. The final condition line just confirms that we actually have some gzipped content to serve up. If all of those conditions are true, we RewriteRule the request to the gzipped content and hey presto, we're done. You are now serving gzipped compressed content to your visitors.