WT Unit 5
WT Unit 5
Web security involves protecting web applications from various cyberattacks that could
compromise data, functionality, or user privacy.
o SQL Injection: Injecting malicious SQL code into input fields to manipulate
database queries, potentially leading to unauthorized access, data theft, or data
corruption.
Prevention: Prepared statements with parameterized queries, input
validation, least privilege for database users.
o Broken Authentication and Session Management: Vulnerabilities related to
improperly implemented authentication or session handling, allowing attackers
to compromise user accounts or sessions.
Prevention: Strong password policies, multi-factor authentication
(MFA), secure session management (e.g., using secure, HttpOnly
cookies, regenerating session IDs).
Web performance optimization (WPO) is the process of improving how quickly web pages
load and respond to user interactions. Faster websites lead to better user experience, higher
conversion rates, and improved search engine rankings.
o Compression: Using algorithms (e.g., Gzip, Brotli) to reduce the size of files
before they are sent over the network. The browser then decompresses them.
o Server-Side Caching:
Application Caching: Storing results of expensive computations or
database queries in memory (e.g., Redis, Memcached).
Database Caching: Databases often have their own internal caching
mechanisms for frequently accessed data.
CDN Caching: CDNs cache content at edge locations closer to users.
o Benefits: Reduces server load, speeds up page load times, minimizes network
traffic.
o Strategies: Proper Cache-Control headers, versioning assets (e.g., style.css?
v=1.2.3 or style.123abc.css), invalidation strategies.