aldm 0 Junior Poster in Training

Hi,
I'm working on rails project where I use json file for storing some
data.
Basically data are stored and get using ajax calls from jquery.

But there are some strange issues.
For example, when I add data in json file using AJAX and then open file
in Chrome: localhost:3000/example.json there are no data. I open the
file in firefox and data exists. When i refresh file in Chrome there are
data. Sometimes data is inserted correctly. Maybe it could be browser
cache issue?

I know that AJAX is asynchronous but sometimes there are few refreshes
needed for data to be added- JSON file is in public folder and I'm
adding data from rails controller like this is txt file. I just convert
hash to json and insert json in file like it's txt file.

What can be problem here?
How can I make inserting and reading data in json file works correctly?
If I'm not clear, I can exaplain this better, just say.

I got it towork on localhost but it doesn't work on production server

I appreciate any kind of help