/    Sign up×
Community /Pin to ProfileBookmark

Linking gzipped files

I just found out about the possibility to have the server send compressed files, but I’m confused as to how I’m supposed to link a gzipped css file. I have a files name ‘4de42cb159110.min.css.gz’ and I tried doing something like

[code=php]<?php
ini_set(‘display_errors’,1);
error_reporting(E_ALL|E_STRICT);

if (substr_count($_SERVER[‘HTTP_ACCEPT_ENCODING’], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>MVM Design</title>
<link href=”[B]scripts/css/4de42cb159110.min.css.gz[/B]” rel=”stylesheet” />// compressed file here
<script src=”scripts/js/jquery 1.52.js”></script>
<script src=”scripts/js/cloud-zoom.1.0.2.js”></script>
<script src=”scripts/js/detectDevice.js”></script>
<script src=”scripts/js/main.js”></script>
</head>[/code]

But this obviously doesn’t work. I realize I’m way off, but I can’t find any tutorials that explain the right way to link the file.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Marius_Miliunas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...