I am trying to add/overwrite the HTTP Responsive Headers to the WHMCS public homepage. Using PHP they should look like this:
header("Cache-Control: public, max-age=10800, must-revalidate"); // HTTP 1.1.
header("Pragma: cache"); // HTTP 1.0.
However, in smarty 3+ the use of php tags is no longer supported.
I have tried the following on the header.tpl file but failed:
{if $templatefile == 'homepage'}
header("Cache-Control: public, max-age=86400, must-revalidate"); // HTTP 1.1.
header("Pragma: cache"); // HTTP 1.0.
{/if}
How would I add these headers to the header.tpl file so they are read as PHP? Thanks.
As I suggested in the comments, you can do this by using
ClientAreaHeadOutputhook, like:You can also use
App::getCurrentFilename()instead of$vars['filename']to get current file name.