3
Contributors
5
Replies
30
Views
4 Years
Discussion Span
Last Post by almostbob
0

if an apache server you can enable mod_gzip or mod_deflate in .htaccess for this filetype something like the codescrap below, which zips the most zippable filetypes

<ifModule mod_gzip.c>
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_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

cache can be set in .htaaccess as well using mod_expires, the instructional search is left to the user, because I dont have the code stuck in my head for that

edit: reread the post,
and
it is considered improper to serve a file located on someone else's server as part of your system unless the other person explicity agrees and offers that service. eg google script, because that third party has to pay the banmdwidth costs, it is considered theft. likewise pinching the code itself is considered theft of intellectual property
the code above only works if the file is hosted on your site
if the author permits, place it on your host, and serve it from there with the appropriate attribution,

Edited by almostbob

0

Also once you download the file to your server, you can just run it through man of the javascript minifiers out there. There are tons online. The most popular library to use right now is UglifyJS it will also shrink your variables which gives you a little obfuscation. I personally just use the online tools that are out there. I usually use Click Here. But I totally agree you should not be using it from someone elses server as you are stealing bandwidth, it is the same thing if someone found your site, then linked pictures from your site to theirs. You would then be serving all of their bandwidth for the images he is serving.

0

I think mod_deflate / mod_gzip is a better suggestion
this line mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
compresses all the filetypes listed, served from the server

0

I apologise for jumping to conclusions
it happens too often, and I just expected it.

I clicked view source, the parameter has to be added somewhere, perhaps in the wordpress plugins being used, just about everything in the page <head> has had the parameter added if it isnt in the source, something has to be doing it in the serverside scripts

<script type="text/javascript" src="http://web.guru99.com/wp-includes/js/perl.js?fe74d6"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?fe74d6">></script>
<script src="http://web.guru99.com/wp-includes/js/code.js?fe74d6"></script>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.