1

It seems that the cache attribute for an apex:page vf component doesn't allow for the use of a visualforce expression.

I am attempting to use a property of a controller to set the cache attribute for a vf page and it isn't working.

The simplest distillation of the problem seems to be as follows:

<apex:page cache="true" showHeader="false" sidebar="false" standardStylesheets="false">
    <head></head>
</apex:page>

Works as expected. No additional meta tags are being injected into the page.

<apex:page cache="{!1==1}" showHeader="false" sidebar="false" standardStylesheets="false">
    <head></head>
</apex:page>

Doesn't work as expected. Even though it should be the same as above it is not. Additional meta tags are injected into the page, as if it had been set as cache="false"

I've tried a variety of other boolean attributes and they all seem to work just fine when I use a vf expression to set their values, for instance, sidebar="{!1==1}". The cache attribute seems to act like it has been set to false if there is anything except the exact value cache="true"

Have I overlooked something obvious or even something known but not as obvious?

Note: The meta tags I'm speaking of are these.

<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE" />
<meta HTTP-EQUIV="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.