Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
Apache's configuration files can be used to configure how Apache operates, but they can also be used to configure PHP and how Apache httpd interacts with PHP. In this talk, Jeff explains the different ways Apache can be configured, explains many of the useful config options available for Apache modules, including our own mod_php, and showcases example of how they can be used with, and instead of, your PHP code.
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
Apache's configuration files can be used to configure how Apache operates, but they can also be used to configure PHP and how Apache httpd interacts with PHP. In this talk, Jeff explains the different ways Apache can be configured, explains many of the useful config options available for Apache modules, including our own mod_php, and showcases example of how they can be used with, and instead of, your PHP code.
SADI for GMOD: Semantic Web Services for Model Organism Databasesbenvvalk
SADI for GMOD is a collection of ready-made SADI services for accessing sequence feature data in RDF form. The services were developed as an add-on for the GMOD (Generic Model Organism Database) project, which is a popular toolkit for building model organism databases and their associated websites (e.g. FlyBase).
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con SymfonyInnoteam Srl
Scrivere un CMF da zero: uno degli strumenti che il mondo PHP/Symfony mette a disposizione per la gestione dei contenuti è PHPCR. Nelle slide di questo talk presentato al SymfonyDay 2018 spieghiamo come abbiamo utilizzato Doctrine PHPCR ODM e API Platform per poter costruire un CMF ed esporre le sue funzionalità in maniera REST. Inoltre mostriamo gli imprevisti che ci ha lasciato e come li abbiamo superati.
From the current offensive and defensive technique arsenal, memory analysis applied to volatile memory is far from being the most explored channel. It is more likely to hear about input validation attacks or attacks against the protocol & cryptography while keys, passphrases, credit card numbers and other precious artifacts are kept unsafely in memory. This analysis arises as a mine waiting to be explored since it is sustained by one of the most vulnerable and unavoidable resource to systems, memory. From Java to Stuxnex, as well as Windows but without forgetting the Cloud, I will try to show some scenarios where these techniques can be applied, its impact as a threat and bring an important and fun subject not just to those who work in forensics but also to penetration testers as myself. Finally, I will also try to show how can this be used for defensive technologies as tools for monitoring and protection in networks with systems in production.
Language Basics | Coldfusion primer | Chap-1Nafis Ahmed
This chapter on Adobe ColdFusion, elaborates on the basics of this HTML-like language. It starts with the by introducing the viewer/reader with the variables, comments and the tags that are behaves like HTML, yet can alternatively be made to syntactically look like other programming languages like PHP. Then, it moves onto examples that demonstrates the ability of structures, lists, variables, loops, conditionals and finally the switch-case statement. This presentation concisely attempts to show the prospective CF programmer that how a old code can be recycled, reinvented, innovated and at the same time made as safe as possible, after all, security is a major concern in today's world.
SADI for GMOD: Semantic Web Services for Model Organism Databasesbenvvalk
SADI for GMOD is a collection of ready-made SADI services for accessing sequence feature data in RDF form. The services were developed as an add-on for the GMOD (Generic Model Organism Database) project, which is a popular toolkit for building model organism databases and their associated websites (e.g. FlyBase).
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con SymfonyInnoteam Srl
Scrivere un CMF da zero: uno degli strumenti che il mondo PHP/Symfony mette a disposizione per la gestione dei contenuti è PHPCR. Nelle slide di questo talk presentato al SymfonyDay 2018 spieghiamo come abbiamo utilizzato Doctrine PHPCR ODM e API Platform per poter costruire un CMF ed esporre le sue funzionalità in maniera REST. Inoltre mostriamo gli imprevisti che ci ha lasciato e come li abbiamo superati.
From the current offensive and defensive technique arsenal, memory analysis applied to volatile memory is far from being the most explored channel. It is more likely to hear about input validation attacks or attacks against the protocol & cryptography while keys, passphrases, credit card numbers and other precious artifacts are kept unsafely in memory. This analysis arises as a mine waiting to be explored since it is sustained by one of the most vulnerable and unavoidable resource to systems, memory. From Java to Stuxnex, as well as Windows but without forgetting the Cloud, I will try to show some scenarios where these techniques can be applied, its impact as a threat and bring an important and fun subject not just to those who work in forensics but also to penetration testers as myself. Finally, I will also try to show how can this be used for defensive technologies as tools for monitoring and protection in networks with systems in production.
Language Basics | Coldfusion primer | Chap-1Nafis Ahmed
This chapter on Adobe ColdFusion, elaborates on the basics of this HTML-like language. It starts with the by introducing the viewer/reader with the variables, comments and the tags that are behaves like HTML, yet can alternatively be made to syntactically look like other programming languages like PHP. Then, it moves onto examples that demonstrates the ability of structures, lists, variables, loops, conditionals and finally the switch-case statement. This presentation concisely attempts to show the prospective CF programmer that how a old code can be recycled, reinvented, innovated and at the same time made as safe as possible, after all, security is a major concern in today's world.
Presentation by Rich Schwerdtfeger, CTO Accessibility IBM Software,
Steve Faulkner Technical Director, The Paciello Group,
Marco Zehe,Mozilla Corporation discussing progress in the development implementation of accessibility support for HTML5.
Sprockets is an easy solution to managing large JavaScript codebases by letting you structure it, bundle it with related assets, and consolidate it as one single file, with pre-baked command-line tooling, CGI front and Rails plugin. It's a framework-agnostic open-source solution that makes for great serving performance while helping you structure and manage your codebase better.
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
Esta é a palestra que dei no Consegi 2010 em Brasília. Sobre dicas gerais sobre web, em particular implementando com Ruby on Rails. YSlow, Full Text Search e Tarefas Assíncronas.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
4. Caching in Rails
‣ Page Caching
‣ ______________
Action Caching
‣ Fragment Caching
5. Caching in Rails
Page Caching Fragment Caching
routing routing routing
before filters before filters before filters
controller controller controller
CACHED
rendering rendering parts CACHED
after filters after filters after filters
illustration by Tammo Freese
8. Caching in Rails
‣ No support for caching in different
languages
‣ No support to expire all language-
caches at once
‣ No support for language-negotiation
12. Format Negotiation
> HTTP “Accept” Header
Accept: text/xml,application/xml,
application/xhtml+xml,text/html
> Rails supports format negotiation
> Rails allows you to request a format
explicitly (extra routes)
13. Format Negotiation
http://www.omdb.org/movies/2062.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Ratatouille</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
http://www.omdb.org/movies/2062.xml
<?xml version="1.0" encoding="UTF-8"?>
<movie>
<name>Ratatouille</name>
<abstract>
Remy is a rat, with a talent and passion for cooking.
He dreams of one day working in a real restaurant
14. Format Negotiation
class MoviesController < ApplicationController
def show
respond_to do |format|
format.html { render }
format.xml { render :xml => @movie.to_xml }
format.js { render :json => @movie.to_json }
end
end
end
15. Language Negotiation
> HTTP “Accept-Language” Header
Accept-Language: en-us,en;q=0.7,de;q=0.3
> Rails ignores the HTTP Header
> Rails doesn’t add language routes
20. Language Routes
# Adding default routes for
# GET /movies/<id>
# GET /movies/<id>.<format>
# PUT /movies/<id>
# PUT /movies/<id>.<format>
# ...
map.resources :movies
map.resources :people
map.resources :casts
21. Language Routes
There are several possible routes, how to add a
language parameter.
http://www.omdb.org/movies/2062.html?lang=de
http://de.omdb.org/movies/2062.html
http://www.omdb.org/de/movies/2062.html
http://www.omdb.org/movies/2062.de.html
http://www.omdb.org/movies/2062.html.de
22. Language Routes
There are several possible routes, how to add a
language parameter.
http://www.omdb.org/movies/2062.html?lang=de
http://de.omdb.org/movies/2062.html
http://www.omdb.org/de/movies/2062.html
http://www.omdb.org/movies/2062.de.html
http://www.omdb.org/movies/2062.html.de
23. Language Routes
# Taken from Rails 1.2.3
# /actionpack-1.13.3/lib/action_controller/resources.rb
# with slight modifications to fit this slide :-)
action_options = action_options_for("show", resource)
map.named_route(
"#{resource.name_prefix}#{resource.singular}",
resource.member_path, action_options
)
map.named_route(
"f_#{resource.name_prefix}#{resource.singular}",
"#{resource.member_path}.:format", action_options
)
24. Language Routes
# Taken from Rails 1.2.3
# /actionpack-1.13.3/lib/action_controller/resources.rb
# with slight modifications to fit this slide :-)
action_options = action_options_for("show", resource)
{ :conditions => { :method => :get },
:requirements => { :id
map.named_route( => /[^/;.,?]+/ },
:action => "show" }
"#{resource.name_prefix}#{resource.singular}",
resource.member_path, action_options
)
map.named_route(
"f_#{resource.name_prefix}#{resource.singular}",
"#{resource.member_path}.:format", action_options
)
25. Language Routes
# Taken from Rails 1.2.3
# /actionpack-1.13.3/lib/action_controller/resources.rb
# with slight modifications to fit this slide :-)
action_options = action_options_for("show", resource)
{ :conditions => { :method => :get },
:requirements => { :id
map.named_route( => /[^/;.,?]+/ },
:action => "show" }
"#{resource.name_prefix}#{resource.singular}",
resource.member_path, action_options
)
map.named_route(
"f_#{resource.name_prefix}#{resource.singular}",
"#{resource.member_path}.:format", action_options
) /movies/:id
26. Language Routes
# Extending
# ActionController::Resources::map_new_actions
# ActionController::Resources::map_member_actions
# and others to support a language parameter
map.named_route(
"fl_#{resource.name_prefix}#{resource.singular}",
"#{resource.member_path}.:format.:lang",
action_options
)
27. Language Routes
# Extending
# ActionController::Resources::map_new_actions
# ActionController::Resources::map_member_actions
# and others to support a language parameter
map.named_route(
"fl_#{resource.name_prefix}#{resource.singular}",
"#{resource.member_path}.:format.:lang",
action_options
) { :conditions => { :method => :get },
:requirements => { :id => /[^/;.,?]+/
:lang => /^fr|de|en$/ },
:action => "show" }
28. Language Routes
http://www.omdb.org/movies/2062.html.en
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Ratatouille</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
http://www.omdb.org/movies/2062.xml.de
<?xml version="1.0" encoding="UTF-8"?>
<movie>
<name>Ratatouille</name>
<abstract>
Remy is a rat, with a talent and passion for cooking.
He dreams of one day working in a real restaurant
30. Accept-Language
# in environment.rb
#
# These are custom extensions, this is not part
# of Rails
AC = ActionController
AC::AbstractRequest.default_language = :en
AC::AbstractRequest.acceptable_languages = :fr, :de, :en
31. Accept-Language
# Taken from Rails 1.2.3
# /actionpack-1.13.3/lib/action_controller/request.rb
# Returns the accepted MIME type for the request
def accepts
@accepts ||=
if @env['HTTP_ACCEPT'].to_s.strip.empty?
[ content_type, Mime::ALL ]
else
Mime::Type.parse(@env['HTTP_ACCEPT'])
end
end
32. Accept-Language
class ActionController::AbstractRequest
def accepts_languages
begin
@accepts_languages ||=
@env['HTTP_ACCEPT_LANGUAGE'].split(",").collect {|l|
l.gsub(/;.*$/, '').gsub(/-.*$/,'').downcase.to_sym
}.push(default_language).uniq
@accepts_languages.delete_if { |l|
!acceptable_languages.include?(l)
}
rescue NoMethodError
@accepts_languages =
default_language.is_a?(Array) ?
default_language : [ default_language ]
end
end
end
34. Accept-Language
class ActionController::AbstractRequest
def language
params[:lang] || accepts_languages.first
end
end
class ApplicationController
before_filter :set_language
def set_language
@language = session[:lang] || request.language
# for Globalize:
# @language = Locale.set(@language)
# for Gettext:
# params[:lang] = @language unless params[:lang]
end
end
35. Language Routes
http://www.omdb.org/movies/2062.html.en
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Ratatouille</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
http://www.omdb.org/movies/2062.xml.de
<?xml version="1.0" encoding="UTF-8"?>
<movie>
<name>Ratatouille</name>
<abstract>
Eine Gourmet-Ratte muss so einiges erleiden,
um ihre Lust auf exquisite Speisen befriedigen zu können.
48. Apache
# Taken from
# http://mongrel.rubyforge.org/docs/apache.html
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI}
[P,QSA,L]
49. Apache
# Taken from
# http://bugs.omdb.org/browser/trunk/conf/webserver/apache.conf
# Perform content-negotiation and send to mongrel
# if not cached.
RewriteCond %{DOCUMENT_ROOT}/%{LA-U:REQUEST_URI} !-f
RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI}
[P,QSA,L]
50. Apache
Apache 2.2 mod_rewrite documentation:
%{LA-U:variable} can be used for look-aheads
which perform an internal (URL-based)
sub-request to determine the final value of
variable.
51. Apache
# Prefer text/html over other Accept Headers
# Simplified RewriteConditions
RewriteCond %{HTTP_ACCEPT} text/html
RewriteCond %{SCRIPT_FILENAME} !.html$
RewriteCond %{IS_SUBREQ} 'false'
RewriteRule ^/(.*)$ /%{SCRIPT_FILENAME}.html [QSA]
# Perform content-negotiation and send to mongrel
# if not cached.
RewriteCond %{DOCUMENT_ROOT}/%{LA-U:REQUEST_URI} !-f
RewriteCond %{IS_SUBREQ} 'false'
RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI}
[P,QSA,L]
68. Fragment Caching
# Delete the fragment for one language
expire_fragment :controller => 'movies',
:action => 'show',
:id => 2062,
:lang => :en
# delete the fragment for all languages
expire_fragment :controller => 'movies',
:action => 'show',
:id => 2062,
70. Test Page Caching
def test_caching_show
accept :xml
# language is a custom extension
language :de
page = "/casts/#{casts(:first).id}.xml.de"
assert_cached_page( page ) do
get :show, :id => casts(:first).id
assert_response :success
end
end
71. Test Page Caching
def test_expire_show
accept :xml
language :de
page = "/casts/#{casts(:first).id}.xml.de"
assert_no_cached_page( page ) do
put :update, :id => casts(:first).id,
:job => Job.composer.id
assert_response :success
end
end
72. Test Fragment Caching
def test_expire_fragment
accept :js
language :en
params = { :controller => 'casts',
:id => casts(:first).id,
:template => 'cast' }
assert_cached_fragment( params ) do
put :update, :id => casts(:first).id,
:job => Job.composer.id
assert_template 'cast'
end
assert_no_cached_fragment( params ) do
casts(:first).save
end
end
73. Where to get the plugins
The plugins are available from
http://svn.omdb-beta.org/plugins/mlr
http://svn.omdb-beta.org/plugins/mlcache
There will be an official announcement on
http://blog.omdb-beta.org/