0

I try to use standart AppCache in Symfony2 to make a gateway caching. The question is the each of theese three ways define when the proxy need to run server script because cache invalid for some reason, and I can use only single of them ?

$response->setETag($article->computeETag()); // 1
$response->setLastModified($article->getPublishedAt()); //2
$response->setMaxAge(600); //3

I read the doc, but for now it little confused me. Thnaks!

1
  • What are you trying to achieve? Read the docs first. There are two kinds of caching you can use - expiration and validation. Commented Jan 21, 2015 at 13:07

1 Answer 1

1

Max age requires last modified.

The ETag is independent of the other two and is a unique identifiert of your page data, so the browser/proxy has a way to check if your content has changed. So it only loads the data from the server if there is a different ETag

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.