Ad
How To Set Cache-Control HTTP Header In OctoberCMS?
My application is returning Cache-Control: no-cache, private
for all pages - how can I change this behaviour?
P.S.: It is not a PHP.ini problem, because changing session.cache_limiter to empty/public does not change anything.
Ad
Answer
You could hook up an event listener to listen to specific events to set the headers
Event::listen('cms.page.display', function ($controller, $url, $page, $result) {
$headers = [
'Cache-Control' => 'max-age=2592000, public',
];
return Response::make($result, $controller->getStatusCode(), $headers);
});
Ad
source: stackoverflow.com
Related Questions
- → How to access the Visual interface for October?
- → How to implement DbDongle::convertTimestamps as workaround of invalid timestamps with MySql strict
- → Laravel 5: Apache php http authentication
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → Disable CSRF TokenMismatch for specific routes on Lumen
- → Change fill color of d3.js node
- → Authenticate with a cookie using laravel 5.1 and jwt
- → What is causing the web page to reload?
- → Is there any way to make an SVG object clickable?
- → Keeping uploaded files secure but still available via https
- → CORS missmatch because of http
- → 500 Internal Server Error Ajax Laravel
- → React: How to publish page on server using React-starter-kit
Ad