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 6254311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:09:32+00:00 2026-05-24T14:09:32+00:00

I have a php script that reads an XML file and modifies it with

  • 0

I have a php script that reads an XML file and modifies it with SimpleXML. After all the modifications are done script saves the file (size ~ 2.8 mb).
I need to load this XML file with jQuery and it takes quite some time. Is there a way to compress/minify my XML file to reduce loading time in my AJAX call.

UPDATE:

The XML file contains SVG for the webpage (large metabolic map) therefore it has to preserve all the contents of XML-nodes.

  • 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-24T14:09:34+00:00Added an answer on May 24, 2026 at 2:09 pm

    EDIT The OP made clear that this is about an SVG file after I wrote my answer.


    Don’t transport 2.5MB of XML to the client if you do not absolutely need all of it on the client (and I doubt you do). A better strategy is to use the XML file like a database:

    • Create a proxy page in PHP that accepts XPath expressions and returns relevant parts of the XML only.
    • Use jQuery to issue Ajax requests that fetch those relevant parts when it becomes necessary (i.e. when the user triggers an action).
    • Use memcached or another caching technique to prevent full XML parsing on the server for every request.
    • Depending on your application use profile, use memcached to cache individual Ajax responses, as well. Additionally, set HTTP caching headers so that the client does not re-request stuff that is still valid.
    • Enable gzip compression for the PHP Ajax responses to save response time and bandwidth.

    It’s a little more work that way. but it will boost speed — probably by several orders of magnitude.

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

Sidebar

Related Questions

I have a PHP script that reads in data from an XML file, returns
I have a small problem with a script that reads an XML file and
I have a jquery script that searches a php file that produces an XML
I have a php script that reads one file through http(the file is on
I have a written a script in PHP that reads from data from a
I have a PHP script that initialises an image gallery. It loops through all
I have a PHP script that processes file uploads. The script tries to organise
I have a PHP script that pushes the headers to allow a file to
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a php file that reads data from my mysqldb as a json

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.