Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Can Smarty be used with Gzip?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gordonisnz
Smarty Regular


Joined: 05 Sep 2009
Posts: 70

PostPosted: Thu Dec 31, 2020 12:18 am    Post subject: Can Smarty be used with Gzip? Reply with quote

https://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

Hi, Ive done a website speed test & it recommends gzipping my site for faster downloads. i found the above site about it.

Does Gzip work well with Smarty ? apart from the actual templates, only a few of my pages are static / un-changing. Most of them extract information from a database & display the information.

If i do use Gzip, is the htaccess example the only thing i need to add ? and everything else will be automatic ?

Im on a shared host - I can alter my php.ini though - but it affects ALL subdomains. I cant alter php.ini just for the subdomain im working on.

EDIT:- smarty-3.1.34
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Thu Dec 31, 2020 2:43 am    Post subject: Reply with quote

When Smarty is done with what it does, the completed page is given back to PHP, and it is PHP's job (or the web server if equipped to do so and that is where you want it done) to do the compression. See:
https://www.php.net/manual/en/zlib.configuration.php

The compression settings can be set anywhere, including in your PHP script.

Smarty is out of the picture with respect to compressing the HTML to be sent.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP