Does Yii Cache external javascript files and CSS files?
-
Does Yii Cache external javascript files and CSS files? I want to cache my home page using Yii cache. The file size of my home page is quite small(excluding js and css). The cached size is 5.7K in my database. I am wondering whether Yii cache external js and css files? I do think It does not cache external images files.
-
Answer:
Yii can cache the dynamic content it generates http://www.yiiframework.com/doc/guide/1.1/en/caching.overview by storing it as static content, including caching http://www.yiiframework.com/doc/guide/1.1/en/caching.data, http://www.yiiframework.com/doc/guide/1.1/en/caching.fragment, etc. Anything queried from the database and dynamically turned into an HTML document by PHP can be cached by the framework. CSS, JS and Images are (usually) already static content, which the framework is not generating, so it cannot cache it. Static content is mostly cached in the client's web browser, or on fast distributed content delivery (CDN) servers. That said, Yii can do a few things to help speed up CSS and JS: http://stackoverflow.com/questions/3626101/whats-the-point-of-yiis-assetmanager allows you to http://www.yiiframework.com/doc/guide/1.1/en/topics.performance#minimizing-script-files (using 3rd party tools) and then "cache" the optimized scripts (in the assets folder). This can also be done with server scripts and extensions. You can also specify different http://www.yiiframework.com/doc/guide/1.1/en/caching.overview#caching, like Memcached and APC, where Yii will store the HTML it caches, but again that does not directly affect your images and CSS/JS.
Evan Lee at Stack Overflow Visit the source
Related Q & A:
- How to convert XML files to PDF files?Best solution by Super User
- how to move files from internal memory to external sdcard in android?Best solution by Stack Overflow
- How to transfer files from my PC to an external hard disk?Best solution by Yahoo! Answers
- How do I get .jar files and .jad files on my phone?Best solution by ehow.com
- Why can't I see the files from my external hard drive?Best solution by answers.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.