CDN

It has been a long time since I last wrote a blog post. In the past few days, I updated the architecture of Infinite Script to accelerate the speed for Chinese users. In this article, I share the new architecture of our website with you. Optimizing a CDN for Static Content Delivery Static content does not change over a period of time. If it does change, the changes are predictable. Static content includes images, CSS sheets, JavaScripts, and PDFfiles. Because of this, CDNs can cache a copy of the content at their edge servers.They can thenserve it whenever a client requests it. CDNs are best at optimizing the delivery of static content from edge servers to users. Therefore, we use the CDN from Alibaba Cloud.
A few days ago, I created TestZilla on Aliyun Elastic Compute Service. However, with the increment of PV, I decided to use CDN to cache static files(images, CSS, and javascript). But there’s no information on how to use CDN with Spring MVC, so I asked a question on StackOverflow. Setup Spring Configuration First of all, you need to use PropertyPlaceholderConfigurer in Spring Configuration(such as dispatcher-servlet.xml) <!-- Property File Location --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:/testzilla.properties</value> </list> </property> </bean> <util:properties id="propertyConfigurer" location="classpath:/testzilla.properties"/> <context:property-placeholder properties-ref="propertyConfigurer" /> Of course, you need to add XML Namespaces:
In this article, you will learn how to create a custom view helper in Zend Framework 2. A concrete example will be used; a helper which generates links for a subdomain, intended for storing static files. This is especially useful if you wish to use a Content Delivery Network (CDN). With very little modification, the helper can be made generic to support links to subdomains for all purposes. The Helper Class Let us begin by creating the helper class. It can be added within any module, but a suitable place would be within the Application module, provided that you made use of the Skeleton Application. Create a file CdnHelper.php in zf2-tutorial\module\Application with the following subdirectories: