Questions tagged [html-compression]

HTML Compression is reducing the size of the HTML pages by eliminating unnecessary white spaces, tabs and newlines.

HTML Compression refers to reducing the size of the HTML pages by eliminating unnecessary white spaces, tabs, newlines. This reflects the page size by making it slower, and therefore faster to load. The compression is often applied to the HTML pages, but also to the CSS and JS files, which can sometimes dramatically decrease the overall page size, which can result in faster page load.

15 questions
27
votes
10 answers

How do I compress HTML in laravel 5

In Laravel 4.0, I use the code below to compress the HTML laravel response outputs to browser, however it doesn't work in laravel 5. App::after(function($request, $response) { if($response instanceof Illuminate\Http\Response) { …
Emeka Mbah
  • 16,745
  • 10
  • 77
  • 96
12
votes
1 answer

How to compress html output in Symfony2?

I know Twig has a {% spaceless %} filter, but it only removes spaces between html tags. I need to return a single line of html for every page in the site. I have a regexp that can deal with that, but I don't know where to use it in sf2, since…
HappyDeveloper
  • 12,480
  • 22
  • 82
  • 117
6
votes
7 answers

HTML Compression and SEO?

At work, we have a dedicated SEO Analyst who's job is to pour over lots of data (KeyNote/Compete etc) and generate up fancy reports for the executives so they can see how we are doing against our competitors in organic search ranking. He also leads…
FlySwat
  • 172,459
  • 74
  • 246
  • 311
4
votes
3 answers

HTML Compressor for asp.net

Anyone knows a good way or tool to compress the HTML that is sent to the client? I was thinking in compressing the HTML in the .aspx files in the production server only, so maybe a tool for doing this would be the right choice.
Bruno
  • 4,337
  • 12
  • 42
  • 55
3
votes
0 answers

Minify and gzip html files in gradle

I have lots of js, css, html file in my gradle web project. I have minified and gzipped my javascript and css files by eriwen's this and this plugins. But couldn't find a way to minify and compress html files in gradle. It can be done by http…
fyelci
  • 1,399
  • 2
  • 16
  • 27
2
votes
0 answers

How to enable Gzip compression in flask?

I have deployed a flask app using heroku. I want to enable gzip compression in it. Usually the tutorials and videos on the youtube show gzip compression for php, wordpress and apache server but how can we do it if we are deploying a flask app using…
1
vote
1 answer

Spring Boot - Filter not applied for noHandlerFoundException

I tried to implement a filter following this answer: How do I minify dynamic HTML responses in Spring? This works very good, however, this filter does not work when the error 404 is thrown. Why not? And how do I apply this filter also for my…
manu
  • 556
  • 2
  • 9
  • 29
1
vote
2 answers

can't find the right compression for this webpage (python requests.get)

I can load this webpage in Google Chrome, but I can't access it via requests. Any idea what the compression problem is? Code: import requests url =…
someguy67
  • 19
  • 3
1
vote
1 answer

JSP - Inline JS Compression / Minification

We have an web application written in Java which has around 150 JSP files. Unfortunately, each of these JSP files contains inline JS code written in it. I'm trying to compress these file to improve the performance. Currently I'm using…
0
votes
3 answers

compress large amount of small files in different folders

In our appliation,we save some images in different folders like: 1 2 3 4 ... 500 ... And inside each folder there are large amount of images whose size is (5kb-20kb). Now we found that when we try to transfer these files,we have to compress them…
hguser
  • 35,079
  • 54
  • 159
  • 293
0
votes
0 answers

Is it possible to remove all inter-tag spaces in an HTML string?

I am using htmlcompressor lib. The compress method does the job. If the input is say "
\n\nhtml\n\n
" It does convert the above to "
html
" It still leaves at least single space around the tags. Is there a way, to say get…
Amogh Talpallikar
  • 12,084
  • 13
  • 79
  • 135
0
votes
1 answer

How to minify inline css in an html using HtmlCompressor?

I am trying to minify an html page via my Java code. I am using https://code.google.com/archive/p/htmlcompressor/ to do the compression. Here is my method for minification : public static String minifyHtml(String html) { HtmlCompressor…
user2456373
  • 53
  • 1
  • 6
0
votes
1 answer

Any preferably open source html compressor written in Javascript?

I am looking for an HTML compressor/minimizer written in Javascript. Say, I have a Javascript variable containing some HTML code, I want to pass it to a Javascript function that will remove unecessary spaces, comments, etc... Does such tool exist? I…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
0
votes
3 answers

Compressing dynamic HTML generated by PHP

I am using PHP for creating some dynamic websites. I have coming across various optimization techniques to optimie my web pages. One among them is HTML compression. Since my web page is having lots of JS, CSS and inline scripts in it. The total size…
Stranger
  • 10,332
  • 18
  • 78
  • 115
-1
votes
1 answer

Symfony2 how to minify html code

I'm using symfony 2.7 then I want to minify my html code. is there a working bundle to do that? I tried https://github.com/MatTheCat/HtmlCompressorBundle but I didn't see any change. Can you help me with that? thanks
persia
  • 21
  • 4