Recent Posts and Articles
This entry is about a two week battle I had to get a production Orchard CMS site able to handle a load of about 3,500 unique users a day and 250,000 hits a day. Originally, the site only had a few visitors a day and was built on Orchard 1.4. with a SQL Compact backend. The site itself has many content items and content types being pulled in on each page so there was a lot of database activity. Site traffic began to increase slowly and I first noticed the production issues when pages began taking more than 5 seconds to load and the CMS itself was taking upwards of 5 minutes to start-up from a cold start. The site was being pinned down by users hitting the site while the pages loaded and every page load was taking a long time to cycle back information from the database with each hit.
This quick tip will show how you can write a custom view for a custom controller action in Orchard that does not use the current theme, but that still retains the ability to use shapes, as well as zones, Script and Style helpers.
Orchard 1.6 RC was released last night and I encourage you to spend a few hours testing it using fresh installations and upgrades of your Orchard CMS Websites. This is a fairly critical version in that it runs on .NET Framework 4.5 and leverages ASP.NET MVC 4, ASP.NET Web API, MySQL and other technologies. I know a lot of Orchard Developers prefer to wait until 1.6 is released before downloading it, but it's more helpful to download and test the RC. Think of it as a RELEASE. We want to catch any bugs before Orchard 1.6 is released as opposed to coming out with a quick Orchard 1.6.1 maintenance release.
Our Orchard Scripting Extensions module what provides re-usable scripting services (and is implemented e.g. for PHP scripting) and what we reported on earlier just got a new feature: scripts are now content items.
What does this mean? You can now have versioned script content items and use them with all of the services. This way scripts have centralized editors and you can re-use scripts, e.g. in multiple actions.
Over the weekend Benedek and Zoltán (me) have worked hard on something very new: adding PHP scripting support for Orchard!
Thanks to the Phalanger project it's possible to compile PHP scripts to .NET assemblies as well as run PHP scripts dynamically by defining the script source at runtime. This comes with full interoperability between the two platforms: PHP scripts can use .NET types and objects can be passed between PHP and .NET. So you can use PHP to script a .NET application like Orchard. Did I mention how awesome this is?
With our two new modules, Orchard Scripting Extensions and Orchard Scripting Extensions: PHP we deliver a set of services to enable running scripts using Orchard services, hooked into Orchard's events. Features are:
- Extensible scripting services: basically with implementing a very simple interface (IScriptingRuntime) you can write your own scripting runtime and thus extend everything that we've already written (see e.g the action below).
- Scripting actions: with the new Script Execution action scripts can be run when an event in the Rules engine is raised. This way scripts can be run e.g. when a content item is published or even scheduled.
- Dashboard testbed: under the Scripting admin menu item you can try out your scripts by running them immediately. The testbed has a decent syntax-highlighted editor thanks to the awesome ACE editor.
- PHP view engine: with the PHP view engine you can have .php views; that means, you can have themes written in PHP!
At last, the Orchard Hungary Team made it's debut as presenters in Hungary too (after being successful a month ago in Los Angeles). Hosted by the university we study at (Óbuda University) Zoltán and I held a session of one and a half hour length on introducing Orchard to a small audience of 20 people (which is the double of what we expected to see).
See the photos taken during the presentation on our Facebook page!
A while ago I mentioned how Orchard 1.6 will be running ASP.NET MVC 4, ASP.NET Web API, and NHibernate 3. I have already covered ASP.NET Web API in more detail in one of my ASP.NET MVC 4 Tutorials, ASP.NET MVC 4 Web API Routes and ApiController, but I thought I would at least give Web API a quick shoutout with Orchard CMS. As with all things Orchard, Web API works exactly as you would expect and can take advantage of the various services and extensions that come with Orchard.
In Orchard 1.6, Orchard Websites can use MySQL as a database along with SQL Server, SQL Express, and SQL Server Compact (Sql CE). Orchard CMS Developers can easily find affordable web hosting that comes with MySQL, making Orchard a very attractive option to small businesses and developers more familiar with MySQL than SQL Server. As you will see in this Orchard Tutorial, using Orchard and MySQL is just as easy as using SQL Server.