The problem is this: I am sending an ajax JSON directory request, but the answer always comes with a status of 200.

request code:

public function getDataAjaxAction(Request $request){ $data = $this->getDoctrine()->getRepository('AppBundle:Land')->find(0); $response = new JsonResponse($data->getJSON()); $response->setEtag(md5($response->getContent())); $response->setPublic(); $response->isNotModified($request); return $response; } 

app.php:

 $loader = require __DIR__.'/../app/autoload.php'; include_once __DIR__.'/../var/bootstrap.php.cache'; $kernel = new AppKernel('prod', false); $kernel = new AppCache($kernel); Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); 

nginx server

Tell me, please, what could be the error or how to find it.

  • What is the problem, actually? Why should not be the 200th status? - Hast
  • Not there looked. Everything is cached. If you look through firefox, then there is a graph transferred. In it is just the phrase "cached" Thank you very much - Nikolay Korotkov

1 answer 1

Not there looked. Everything is cached. If you look through firefox, then there is a graph transferred. In it is just the phrase "cached" Thank you very much - Nikolay Korotkov 1 minute ago

  • such questions should be closed so as not to clog the Internet ;-) - Michael Sivolobov