Cache control by Zend. How does it work with website?

Maarten Munning
Maarten Munning
7
| 1 0 1
Asked on 9/22/17, 2:28 PM
0
vote
222 Views

There is a configuration setting session.cache_limiter that controls the caching HTTP headers that will be sent with the response. The default setting here is nocache which sends

Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache

You overwrite all of these headers within your controller besides the Cache-Control-header (you only append your max-age=3600 setting here).

 

Possible solutions are:

  1. changing the PHP configuration (session.cache_limiter) to e.g. none - but this could introduce problems to other PHP applications
  2. set the session.cache_limiter on each request using session_cache_limiter()
  3. overwrite the full Cache-Control-header in your controller with the designated string

The possible values for session.cache_limiter and session_cache_limiter() are:

none: no header will be sent

nocache:

Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache

private:

Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: private, max-age=10800, pre-check=10800

private_no_expire:

Cache-Control: private, max-age=10800, pre-check=10800

public:

Expires: pageload + 3 hours Cache-Control: public, max-age=10800

Maarten Munning
Maarten Munning
7
| 1 0 1
Answered on 9/22/17, 2:31 PM
0
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 9/22/17, 2:28 PM
Seen: 222 times
Last updated: 9/22/17, 2:35 PM