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?

1
  • you can try looking for php version of npmjs.com/package/grunt-angular-templates, which preload templates into $templateCache. so no additional http requests for templateURLs Commented Apr 21, 2015 at 13:55

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
If you're running a bare PHP implementation, then I guess you could just follow the steps outlined in other answers and blog posts
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.