How can we save Ram usages using some wordpress theme tricks

While running wordpress site, save Ram usage is always great idea and you can easily improve the site performance by simple wordpress theme tricks.

We mostly use the get_permalink(), get_the_title() methods in our wordpress theme. Do not pass the post ID as parameter.

if you’re doing a get_permalink or get_title() call with Post id, 8 out of 10 times you’ll need to more of that post than just the permalink, so this isn’t really a problem.

save Ram usage

Post object is actually already slightly faster than calling get_permalink with $post->ID (in get_post it then only sanitizes and adds to cache, it doesn’t fetch new data), but the real benefit comes when you add a variable called filter in the $post object, setting it to “sample”. Now you decide whether that post object is going to be cached or not and which variables it contains.

Pass the $Post object instead of Post ID.

Do not use the Custom fields. Your server need to fire extra custom quries on Mysql server.

If your are using $wpdb->get_results or new WP_Query( $args ) then add the order by.

How can we save Ram usages using some wordpress theme tricks
How can we save Ram usages using some wordpress theme tricks

How to use juggernaut in Rails project

Juggernaut is the Rails plugin for sending and receiving data in different thread. It gives you real time connection to server and you can implement different ideas work or fulfil your requirement.

Juggernaut uses the eventmachine as a server.

So install the supported gem first.

#gem install json

#gem install eventmachine

#gem install juggernaut

Juggernaut is aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client.

Juggernaut is used for speciallycreating Chat application.

If you want to full details about Juggernaut then go to http://juggernaut.rubyforge.org/

First install the juggernaut to your application using this command.
ruby script/plugin install git://github.com/maccman/juggernaut_plugin.git

install the gem : gem install juggernaut

Configure the gem: juggernaut –g juggernaut.yml

Start the Juggernaut server: juggernaut -c juggernaut.yml

(This is not rails server or mongrel server)

In your controller you can use this method to send data to Juggernaut server

Juggernaut.send_to_all(“alert(‘hi from juggernaut’)”)

If you want customize the Juggernaut methods or add new methods then open file:

/vender/plugin/juggernaut_plugin/lib/juggernaut.rb

Add your methods there and use in your projects.