Browser Hosting

How to Tell Browser Not To Cache your Website or Blogs

Many Webmaster don’t want Browser to cache their website for many reasons and if you also don’t want then simply use this code in your header.php file.But before you try this you must be aware that cache improve your website speed and also help you to give higher rank in google search results

How to Tell Browser Not To Cache your Website or Blogs

If you are WordPress user then you need to avoid using any cache plugin or avoid page cache Setting, because if you do this then your browser will not reflect changes immediately.

If you want to do this in PHP you can use the header function to send the appropriate HTTP headers to the browser:

header(‘Cache-Control: no-cache’);
header(‘Pragma: no-cache’);

Why to and Why not to Use cache

If your website Keep on updating content regularly and you want to show updated content in real-time then you need to use no cache for those content, you can also set time period for Cache like 24 Hour, 1 Hour etc, however you can use cache for fixed file like CSS ,JS, logo etc. This will improve user Experience when they surf your blog or website.

Improve Website Speed using 3rd Party Plugin and Website

Some 3rd party website like CloudFlare, Maxcdn, provide you option to use cache for your permanent file, If you are WordPress user then you can try using w3 total cache plugin or wp super cache plugin to improve your website speed


Default 755 File Permission Issue From Server Setting

If you are getting file permission issue from your server side and you unable to find the solution for this problem, then you must try solution below. Many servers by default don’t support 755 permission. Instead, they use 777 and which is very risky for the webmaster.

So for this, you need to look some server setting like mod_cgi and mod_suexec

Why 755 Permissions not working in your Server

This happened when the server was using mod_cgi which was running PHP processes as user “Nobody” which prevented PHP from writing into website directory when permissions haven’t allowed so.

Solution for 755 permission to Work

Change your handler for Apache to mod_mpm_event and enabled mod_cgid and mod_suexec which allow running PHP processes as a specific user. This change will resolve issue with upload issue

This will solve your problem; Please read carefully before you implement this change or discuss with your hosting provider about this.

Disable Directory Listing from Apache

Changing Folder permission will not disable directory listing for directory listen you need to add .htaccess file Simply create a .htaccess file with below Text and Upload that in your upload directory and this will disable Directory Listing on that website.

Options -Indexes

If you want to disable Directory Listing in your whole server, then you can do this using apache in /etc/apache/httpd.conf Contact your host, and they will do this for you.


Litespeed Tuning Setting for Max PHP suexec Connection

LiteSpeed Web Server (LSWS) is lightweight, high-performance Apache replacement that increase performance of server by reducing load on server Upgrading takes 15 minutes and improve your performance by reducing harware usage.

One of the advantages LiteSpeed Web Server (LSWS) is a small performance in transaction files are highly efficient when compared with apache,many website are shifting to LSWS for good performance . so for this we are sharing some tuning tips

To use LSWS with suexec condition turned off, LSWS can work directly with optimized performance.

When to change LSWS Settings

Check the max number CONNection and inclusive use of Live Stats LSWS connection. If the numbers In Use has often approached max CONNection, marks the limit should be raised.

Litespeed Tuning Setting for Max PHP suexec Connection

Above image shows that it reached max connection limit so we will raise this limit ,Go to LSWS admin panel from your server WHM.After that, select the Configuration >> Server >> General

Litespeed Tuning Setting for Max PHP suexec Connection

After that, find the setting that says “PHP suexec Max Conn”, by default the value is low, 20

Litespeed Tuning Setting for Max PHP suexec Connection

Increase the value to a number that works for your website requirements, or that fit your website. After that, press “Save, if ther number is above 1000 then consult your hosting provider because your server may require more ram or memory to handle traffic

Litespeed Tuning Setting for Max PHP suexec Connection

After that, there will be a warning to LSWS restarted to activate the new setting. Follow it, press the “Apply Changes