Posts Tagged PHP

Enabling Gzip with ngnix

Gzipping has its advantages, it compresses CSS, JS and HTML so that your response time increases. Lets say that you save 100KB per hit after Gzipping, now say you get 1000 unique hits per day, that will  be 100MB of data saved a day, pretty huge saving. I am using Ngnix now predominantly, so ngnix.conf file will be present in /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf in Ubuntu / Debian , open it up, goto end, add these lines


# enable gzip compression
gzip on;
gzip_min_length  1100;
gzip_buffers  4 32k;
gzip_types    text/plain application/x-javascript text/xml text/css;
gzip_vary on;
# end gzip configuration

Save and exit and type this command in bash


$ /etc/init.d/nginx reload

Once done gzip will be enabled. If you want you can set the encryption level by specifying another parameter


## Set gzip compression level at 1 – lowest and also the default.
gzip_comp_level 1;

Or to set it at the highest level (when you have lot of data served, give this one


## Set gzip compression level at 9 – highest parameter.
gzip_comp_level 9;

, , , , ,

1 Comment

Missing Rails Elegance

The Hndu Numerals

Our office is dominated by PHP guys. I was in here to manage them, for some reason we decided to code our new project in PHP, possibly I did not push hard . There were multitude of reason given not to take up Rails, the result is very bad, and I am feeling it right in first week.

We had to work overtime due to tight deadlines, I am tired and droopy as I write this blog, I had to do an image upload for which I am going to take hours, which in Rails will be less than 15 minute job. I had to write lot of boiler plate code.

There is a fear that we won’t get Rails developers and they demand very high, hmmm, that’s right. But once you build a Rails team, things will get rolling. PHP is no bad, but if you have strict deadlines and are over ambitious it will burn out your coders and speed will drop.

PHP needs lot of planning, lot of testing, lot of typing.  To say short PHP is Roman numerals and Rails is Hindu numerals. There is no wrong with Roman numerals, well.. then the civilizations that used Hindu numerals raced pass those using Roman, that’s it. Believe it or not, in fact people once hated Hindu numerals one time. Florence banned it then!

Looks like great things will take time to get adapted by humans.

,

1 Comment

Moving From PHP to Ruby on Rails

Techartus is conducting a seminar (in Chenai, India) this Saturday (21 June 2014) 9AM to 1PM on Ruby on Rails, especially targeting PHP developers. The following are the topics that will be covered:

  1. Moving from PHP to Ruby
  2. Model View and Controller
  3. What’s Ruby why its becoming popular?
  4. Ruby on Rails (aka Rails) philosophy, why it caught as wild fire?
  5. Why there aren’t any big CMS in Rails?
  6. How is Rails evolving with time?
  7. Current trends in Rails
  8. If the future is Javascript, how Rails will fit in?

To subscribe please checkout http://eepurl.com/UNmUr

, , , , , , , , ,

Leave a comment