1

I want to optimize the page loading, using PHP and scripting language. Is there any way to compress the HTML which is being loaded from the template URL, so that based on that scenario I can achieve the goal?

fero
  • 6,050
  • 1
  • 33
  • 56
Gangnam
  • 108
  • 1
  • 5
  • you can try looking for php version of https://www.npmjs.com/package/grunt-angular-templates, which preload templates into $templateCache. so no additional http requests for templateURLs – YOU Apr 21 '15 at 13:55

2 Answers2

2

Most webservers will automatically compress HTTP GET requests with something like gzip. Just make sure to turn on server compression for your php server.

Adam Kewley
  • 1,224
  • 7
  • 16
  • Can you list the server name? Or any other way to compress the HTML content? if any library is available or not,please share with me. we can also compress using .htaccess so such away that we can compress the HTML using angular or not? – Gangnam Apr 21 '15 at 11:40
  • If you're running a bare PHP implementation, then I guess you could just follow the steps outlined in [other answers](http://stackoverflow.com/questions/4709076/how-to-enable-gzip) and [blog posts](http://www.feedthebot.com/pagespeed/enable-compression.html) – Adam Kewley Apr 21 '15 at 12:00
1

Compress the HTML on the server, not on the client. E.g. a build step or a step before serving the file.

Georgi-it
  • 3,676
  • 1
  • 20
  • 23