Optimize ajax setting