Submitted by Kirti Singh on 11/Jun/2016 11:45
Enabling browser side caching
Browser side caching can greatly impact web page rendering speed whenever there are repeat visits. Simply put. A browser would typically look into its own local cache before making a HTTP request to the server.
On Apache mod_expires needs to be installed. Now putting the following content in your .htaccess will let the browser know that this content is cachable. For different file types, different cache durations can be enabled and based on various base parameter like access time or modification time.
Below in the example implementation. And its pretty self explanatory.
################
ExpiresActive On
# expires after 7 days based on access time
ExpiresDefault A604800
# expires after 1 month based on access time
ExpiresDefault A2592000
################
Browser side caching can greatly impact web page rendering speed whenever there are repeat visits. Simply put. A browser would typically look into its own local cache before making a HTTP request to the server.
On Apache mod_expires needs to be installed. Now putting the following content in your .htaccess will let the browser know that this content is cachable. For different file types, different cache durations can be enabled and based on various base parameter like access time or modification time.
Below in the example implementation. And its pretty self explanatory.
################
ExpiresActive On
# expires after 7 days based on access time
ExpiresDefault A604800
# expires after 1 month based on access time
ExpiresDefault A2592000
################
Submitted by Kirti Singh on 10/Jun/2016 09:56
Enabling gzip compression
A simple optimization technique which can greatly impact a webpage's loading performance.
If on Apache mod_deflate is installed, adding this magical line in your .htaccess can make your website load 3x or 4x faster.
##########################
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
##########################
A simple optimization technique which can greatly impact a webpage's loading performance.
If on Apache mod_deflate is installed, adding this magical line in your .htaccess can make your website load 3x or 4x faster.
##########################
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
##########################