We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Why Phalcon so long loads css, js files from the cache?

Hello.

Why Phalcon so long loads css, js files from the cache?

When I use Phalcon

When using a simple php, all normally loaded

Is it normal?

No its not, but its not phalcon problem i guess. Its telling you (from cache) so it doesnt even doing request.

What is your definition of assets service? How do you load css files?



12.4k

I use this in layout

<?php echo $this->tag->stylesheetLink(array('href' => 'css/bootstrap.min.css', 'media'=> 'screen')) ?>
<?php echo $this->tag->stylesheetLink(array('href' => 'css/style.css', 'media'=> 'screen')) ?>
<?php $this->assets->outputCss() ?>

<!-- Scripts -->
<?php echo $this->tag->javascriptInclude(array('src' => 'js/jquery.min.js')) ?>
<?php echo $this->tag->javascriptInclude(array('src' => 'js/bootstrap.min.js')) ?>
<?php $this->assets->outputJs() ?>

So, where the caching actually occurs? What you provided is just a layout, not services definition (DI -> IoC).

edited Feb '16

Caching occurs in webbrowser, its not phalcons problem. You dont even making a request to those static files. Your application is making request only to /login