Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6123383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:00:37+00:00 2026-05-23T16:00:37+00:00

I am creating a mobile service based on Pyramid framework. Because it’s mobile everything

  • 0

I am creating a mobile service based on Pyramid framework. Because it’s mobile everything to reduce bandwidth usage is plus. I am considering gzipping all the traffic, even dynamic HTML pages.

What kind of hooks Pyramid framework provides for this? Or is there WSGI middleware for the task? I’d like to do this still on Python level, not Nginx/Apache, so I can better statistics how much gzip brings benefirts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:00:38+00:00Added an answer on May 23, 2026 at 4:00 pm

    First of all I should stress that you should do this on the web server level (nginx or apache). There are several reasons for this:

    1. Performance – If you do this in Python you are using one of your threads that could be handling requests to do cpu-intensive compression. This is way less efficient than allowing your optimized web server to handle it.

    2. Blocking – Most GZip middleware will block your responses, buffering the body so that it can compress the entire response. This is a huge problem if you are attempting to stream any response back to the client because it will get caught in middleware. This is actually a violation of PEP333, the WSGI specification.

    With all of this in mind, it might make sense to do it in Python at least for debugging purposes during development.

    Since you’re already using Pyramid then you have Paste installed. Thus you can simply add the paste.gzipper.GzipMiddleware to your application’s pipeline like so:

    [filter:gzip]
    use = egg:Paste#gzip
    compress_level = 6
    
    [pipeline:main]
    pipeline =
        gzip
        app
    

    Obviously if you don’t want to change the compression level from the default of 6 you can simply add the egg:Paste#gzip to the pipeline in place of configuring the filter and giving it a custom name (gzip).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a mobile app and it requires a API service backend to get/put
I am creating a service which receives some data from mobile phones and saves
I am creating a mobile web application using asp.net. The application must support iPhone,
I'm creating a Windows Mobile 6 application using MFC Single Document Interface with CFormView
I am creating a Windows Mobile Application in C# and Visual Studio 2008. The
I am creating a C# Windows Mobile application that I need to programmatically invoke
We are creating sample application for windows mobile using Rijndael algorithm. Its working fine.
A little background: I'm creating a set of adapters to allow communication with mobile
I am creating an service which is use Service Component ,I want to run
I'm creating a simple HTTP proxy that will sit between mobile apps and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.