save setting data to userdefaults and using cache data in ViewController