Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

FOUC in Silverstripe


Reply


2 Posts   442 Views

Avatar
SamTheJarvis

Community Member, 24 Posts

18 January 2012 at 3:12am

Hey,

On a few of my sites when using Requirements::CSS etc. when clicking between pages there's a very brief flash of white, before every page load, in every browser. This doesn't happen on every site using requirements.

My remedy to this is to not use Requirements or <% require %> and use <link>, a mild inconvenience and not ideal.

I notice Silverstripe puts a timestamp on the end of required file paths, what's the purpose of that? Could it be causing the issue? Because essentially the only difference between using the requirements and using <link> is this timestamp, and that required css are at the bottom of the <head> tag.

Again, this is happening across a few sites, no current examples as they are all live and using <link>.

Thanks.

Avatar
MarcusDalgren

Community Member, 288 Posts

18 January 2012 at 8:45am

I do believe the timestamp is for versioning so when you update the CSS file or whatever the timestamp changes. This way the newer version will always be loaded instead of hitting the browser cache. Otherwise there's no difference whatsoever and there's no processing being done when the page hits the browser. It's all server side.